21 lines
638 B
JavaScript
21 lines
638 B
JavaScript
|
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);
|
||
|
|
||
|
expect(invoiceIntotals.totalTaxableBase).toEqual(invoiceIntotals.totalDueDay);
|
||
|
|
||
|
await tx.rollback();
|
||
|
} catch (e) {
|
||
|
await tx.rollback();
|
||
|
throw e;
|
||
|
}
|
||
|
});
|
||
|
});
|