2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 11:29:00 +00:00
books/tests/test_meta.js

22 lines
658 B
JavaScript
Raw Normal View History

2018-01-12 12:25:07 +00:00
const assert = require('assert');
2018-01-16 06:09:17 +00:00
const frappe = require('frappejs');
2018-01-12 12:25:07 +00:00
const helpers = require('./helpers');
describe('Meta', () => {
before(async function() {
await helpers.init_sqlite();
});
it('should get init from json file', () => {
let todo = frappe.get_meta('ToDo');
2018-01-31 12:56:21 +00:00
assert.equal(todo.is_single, 0);
2018-01-12 12:25:07 +00:00
});
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'));
});
});