2
0
mirror of https://github.com/frappe/books.git synced 2024-12-27 12:42:44 +00:00
books/tests/test_single.js

24 lines
794 B
JavaScript
Raw Normal View History

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() {
await helpers.initSqlite();
2018-02-12 12:01:31 +00:00
});
it('should set a single value', async () => {
let systemSettings = await frappe.getSingle('SystemSettings');
2018-02-12 12:01:31 +00:00
systemSettings.dateFormat = 'dd/mm/yyyy';
await systemSettings.update();
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();
systemSettings = await frappe.getSingle('SystemSettings');
2018-02-12 12:01:31 +00:00
assert.equal(systemSettings.dateFormat, 'mm/dd/yyyy');
});
});