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

18 lines
547 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);
2018-09-11 13:09:15 +00:00
expect(result.totalNewPrice).toEqual(22.33);
expect(result.totalDifference).toEqual(0);
});
});