2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/tests/test_number_series.js

16 lines
626 B
JavaScript
Raw Normal View History

2018-02-07 16:44:59 +00:00
const assert = require('assert');
const frappe = require('frappejs');
const helpers = require('./helpers');
describe('Number Series', () => {
2018-02-07 16:44:59 +00:00
before(async function() {
await helpers.init_sqlite();
});
it('should start a series and get next value', async () => {
frappe.db.delete('Number Series', 'test-series-')
assert.equal(await frappe.model.get_series_next('test-series-'), 'test-series-1');
assert.equal(await frappe.model.get_series_next('test-series-'), 'test-series-2');
assert.equal(await frappe.model.get_series_next('test-series-'), 'test-series-3');
});
});