2018-02-12 12:01:31 +00:00
|
|
|
const assert = require('assert');
|
|
|
|
const frappe = require('frappejs');
|
|
|
|
const helpers = require('./helpers');
|
|
|
|
|
|
|
|
describe('Single Documents', () => {
|
|
|
|
before(async function() {
|
2018-02-16 13:13:46 +00:00
|
|
|
await helpers.initSqlite();
|
2018-02-12 12:01:31 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should set a single value', async () => {
|
2018-02-16 13:13:46 +00:00
|
|
|
let systemSettings = await frappe.getSingle('SystemSettings');
|
2018-02-12 12:01:31 +00:00
|
|
|
systemSettings.dateFormat = 'dd/mm/yyyy';
|
|
|
|
await systemSettings.update();
|
|
|
|
|
2018-02-16 13:13:46 +00:00
|
|
|
systemSettings = await frappe.getSingle('SystemSettings');
|
2018-02-12 12:01:31 +00:00
|
|
|
assert.equal(systemSettings.dateFormat, 'dd/mm/yyyy');
|
|
|
|
|
|
|
|
systemSettings.dateFormat = 'mm/dd/yyyy';
|
|
|
|
await systemSettings.update();
|
|
|
|
|
2018-02-16 13:13:46 +00:00
|
|
|
systemSettings = await frappe.getSingle('SystemSettings');
|
2018-02-12 12:01:31 +00:00
|
|
|
assert.equal(systemSettings.dateFormat, 'mm/dd/yyyy');
|
|
|
|
});
|
|
|
|
});
|