22 lines
589 B
JavaScript
22 lines
589 B
JavaScript
const models = require('vn-loopback/server/server').models;
|
|
|
|
describe('order getTotalVolume()', () => {
|
|
it('should return the total', async() => {
|
|
const tx = await models.Order.beginTransaction({});
|
|
|
|
try {
|
|
const options = {transaction: tx};
|
|
|
|
const result = await models.Order.getTotalVolume(1, options);
|
|
|
|
expect(result.totalVolume).toEqual(1.568);
|
|
expect(result.totalBoxes).toEqual(11.1);
|
|
|
|
await tx.rollback();
|
|
} catch (e) {
|
|
await tx.rollback();
|
|
throw e;
|
|
}
|
|
});
|
|
});
|