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

18 lines
549 B
JavaScript
Raw Normal View History

2018-12-21 11:50:28 +00:00
const app = require(`${serviceRoot}/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);
2019-01-11 11:25:53 +00:00
expect(result.totalNewPrice).toEqual(22.29);
expect(result.totalDifference).toEqual(0.8);
});
});