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() {
|
2018-02-16 13:13:46 +00:00
|
|
|
await helpers.initSqlite();
|
2018-01-12 12:25:07 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should get init from json file', () => {
|
2018-02-08 06:46:38 +00:00
|
|
|
let todo = frappe.getMeta('ToDo');
|
2018-02-12 12:01:31 +00:00
|
|
|
assert.equal(todo.isSingle, 0);
|
2018-01-12 12:25:07 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should get fields from meta', () => {
|
2018-02-08 06:46:38 +00:00
|
|
|
let todo = frappe.getMeta('ToDo');
|
2018-01-12 12:25:07 +00:00
|
|
|
let fields = todo.fields.map((df) => df.fieldname);
|
|
|
|
assert.ok(fields.includes('subject'));
|
|
|
|
assert.ok(fields.includes('description'));
|
|
|
|
assert.ok(fields.includes('status'));
|
|
|
|
});
|
|
|
|
});
|