2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00
books/tests/test_single.js
2018-02-12 17:31:31 +05:30

24 lines
798 B
JavaScript

const assert = require('assert');
const frappe = require('frappejs');
const helpers = require('./helpers');
describe('Single Documents', () => {
before(async function() {
await helpers.init_sqlite();
});
it('should set a single value', async () => {
let systemSettings = await frappe.getSingle('System Settings');
systemSettings.dateFormat = 'dd/mm/yyyy';
await systemSettings.update();
systemSettings = await frappe.getSingle('System Settings');
assert.equal(systemSettings.dateFormat, 'dd/mm/yyyy');
systemSettings.dateFormat = 'mm/dd/yyyy';
await systemSettings.update();
systemSettings = await frappe.getSingle('System Settings');
assert.equal(systemSettings.dateFormat, 'mm/dd/yyyy');
});
});