21 lines
643 B
JavaScript
21 lines
643 B
JavaScript
const models = require('vn-loopback/server/server').models;
|
|
|
|
describe('invoiceIn summary()', () => {
|
|
it('should return a summary object containing data from one invoiceIn', async() => {
|
|
const tx = await models.InvoiceIn.beginTransaction({});
|
|
const options = {transaction: tx};
|
|
|
|
try {
|
|
const summary = await models.InvoiceIn.summary(1, options);
|
|
|
|
expect(summary.supplierRef).toEqual('1234');
|
|
expect(summary.totals.totalTaxableBase).toEqual(352.24);
|
|
|
|
await tx.rollback();
|
|
} catch (e) {
|
|
await tx.rollback();
|
|
throw e;
|
|
}
|
|
});
|
|
});
|