2018-01-12 17:55:07 +05:30
|
|
|
const assert = require('assert');
|
2018-01-16 11:39:17 +05:30
|
|
|
const frappe = require('frappejs');
|
2018-01-12 17:55:07 +05:30
|
|
|
const helpers = require('./helpers');
|
|
|
|
|
|
|
|
describe('Meta', () => {
|
|
|
|
before(async function() {
|
|
|
|
await helpers.init_sqlite();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should get init from json file', () => {
|
2018-02-08 12:16:38 +05:30
|
|
|
let todo = frappe.getMeta('ToDo');
|
2018-01-31 18:26:21 +05:30
|
|
|
assert.equal(todo.is_single, 0);
|
2018-01-12 17:55:07 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('should get fields from meta', () => {
|
2018-02-08 12:16:38 +05:30
|
|
|
let todo = frappe.getMeta('ToDo');
|
2018-01-12 17:55:07 +05:30
|
|
|
let fields = todo.fields.map((df) => df.fieldname);
|
|
|
|
assert.ok(fields.includes('subject'));
|
|
|
|
assert.ok(fields.includes('description'));
|
|
|
|
assert.ok(fields.includes('status'));
|
|
|
|
});
|
|
|
|
});
|