salix/modules/invoiceIn/back/methods/invoice-in/specs/getSerial.spec.js

22 lines
695 B
JavaScript
Raw Normal View History

2023-03-28 09:34:14 +00:00
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);
});
});