salix/modules/ticket/back/methods/sale/specs/priceDifference.spec.js

18 lines
547 B
JavaScript
Raw Normal View History

2019-01-24 08:08:28 +00:00
const app = require('vn-loopback/server/server');
describe('sale priceDifference()', () => {
2018-08-17 06:41:30 +00:00
it('should return ticket price differences', async() => {
let data = {
2018-08-17 06:41:30 +00:00
landed: new Date(),
addressFk: 121,
agencyModeFk: 1,
warehouseFk: 1
};
2018-08-17 06:41:30 +00:00
let result = await app.models.Sale.priceDifference(1, data);
expect(result.totalUnitPrice).toEqual(22.33);
expect(result.totalNewPrice).toEqual(22.27);
expect(result.totalDifference).toEqual(0.87);
});
});