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

22 lines
714 B
JavaScript
Raw Normal View History

2021-11-18 07:21:02 +00:00
const models = require('vn-loopback/server/server').models;
describe('invoiceIn getTotals()', () => {
it('should check that returns invoiceIn totals', async() => {
const invoiceInId = 1;
const tx = await models.InvoiceIn.beginTransaction({});
const options = {transaction: tx};
try {
const invoiceIntotals = await models.InvoiceIn.getTotals(invoiceInId, options);
2022-01-20 09:05:24 +00:00
expect(typeof invoiceIntotals.totalTaxableBase).toBe('number');
2021-11-18 07:21:02 +00:00
expect(invoiceIntotals.totalTaxableBase).toEqual(invoiceIntotals.totalDueDay);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});