salix/modules/order/back/methods/order/specs/getTotal.spec.js

20 lines
518 B
JavaScript

const models = require('vn-loopback/server/server').models;
describe('order getTotal()', () => {
it('should return the order total', async() => {
const tx = await models.Order.beginTransaction({});
try {
const options = {transaction: tx};
const result = await models.Order.getTotal(1, options);
expect(result).toEqual(155.89);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});