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

16 lines
620 B
JavaScript

const assert = require('assert');
const frappe = require('frappejs');
const helpers = require('./helpers');
describe('Number Series', () => {
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.getSeriesNext('test-series-'), 'test-series-1');
assert.equal(await frappe.model.getSeriesNext('test-series-'), 'test-series-2');
assert.equal(await frappe.model.getSeriesNext('test-series-'), 'test-series-3');
});
});