2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00
books/tests/test_single.js

24 lines
794 B
JavaScript

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