22 lines
695 B
JavaScript
22 lines
695 B
JavaScript
|
const models = require('vn-loopback/server/server').models;
|
||
|
|
||
|
describe('invoiceIn getSerial()', () => {
|
||
|
it('should check that returns without serial param', async() => {
|
||
|
const result = await models.InvoiceIn.getSerial(45);
|
||
|
|
||
|
expect(result.length).toBeGreaterThan(0);
|
||
|
});
|
||
|
|
||
|
it('should check that returns with serial param', async() => {
|
||
|
const result = await models.InvoiceIn.getSerial(45, 'R');
|
||
|
|
||
|
expect(result.length).toBeGreaterThan(0);
|
||
|
});
|
||
|
|
||
|
it('should check that returns with non exist serial param', async() => {
|
||
|
const result = await models.InvoiceIn.getSerial(45, 'Mock serial');
|
||
|
|
||
|
expect(result.length).toEqual(0);
|
||
|
});
|
||
|
});
|