2018-01-01 14:57:59 +05:30
|
|
|
const assert = require('assert');
|
|
|
|
const frappe = require('frappe-core');
|
|
|
|
|
|
|
|
describe('Meta', () => {
|
|
|
|
before(function() {
|
|
|
|
frappe.init();
|
2018-01-01 15:58:30 +05:30
|
|
|
frappe.db.migrate();
|
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'));
|
|
|
|
});
|
|
|
|
});
|