2
0
mirror of https://github.com/frappe/books.git synced 2025-02-03 04:28:32 +00:00
books/frappe/tests/test_meta.js

22 lines
594 B
JavaScript
Raw Normal View History

2018-01-01 14:57:59 +05:30
const assert = require('assert');
const frappe = require('frappe-core');
2018-01-03 12:19:59 +05:30
const helpers = require('./helpers');
2018-01-01 14:57:59 +05:30
describe('Meta', () => {
2018-01-02 15:40:32 +05:30
before(async function() {
2018-01-03 12:19:59 +05:30
await helpers.init_sqlite();
2018-01-01 14:57:59 +05:30
});
it('should get init from json file', () => {
let todo = frappe.get_meta('ToDo');
assert.equal(todo.issingle, 0);
});
it('should get fields from meta', () => {
let todo = frappe.get_meta('ToDo');
let fields = todo.fields.map((df) => df.fieldname);
assert.ok(fields.includes('subject'));
assert.ok(fields.includes('description'));
assert.ok(fields.includes('status'));
});
});