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

21 lines
643 B
JavaScript
Raw Normal View History

const models = require('vn-loopback/server/server').models;
2021-04-15 08:44:25 +00:00
describe('invoiceIn summary()', () => {
it('should return a summary object containing data from one invoiceIn', async() => {
const tx = await models.InvoiceIn.beginTransaction({});
2021-06-28 08:15:54 +00:00
const options = {transaction: tx};
2021-04-15 08:44:25 +00:00
2021-06-28 08:15:54 +00:00
try {
const summary = await models.InvoiceIn.summary(1, options);
2021-06-28 08:15:54 +00:00
expect(summary.supplierRef).toEqual('1234');
2021-07-15 10:51:10 +00:00
expect(summary.totals.totalTaxableBase).toEqual(252.25);
2021-06-28 08:15:54 +00:00
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
2021-04-15 08:44:25 +00:00
});
});