2018-12-21 11:50:28 +00:00
|
|
|
const app = require(`${serviceRoot}/server/server`);
|
2018-05-16 06:13:39 +00:00
|
|
|
|
|
|
|
describe('sale priceDifference()', () => {
|
2018-08-17 06:41:30 +00:00
|
|
|
it('should return ticket price differences', async() => {
|
2018-05-16 06:13:39 +00:00
|
|
|
let data = {
|
2018-08-17 06:41:30 +00:00
|
|
|
landed: new Date(),
|
2018-06-26 07:41:27 +00:00
|
|
|
addressFk: 121,
|
2018-05-30 08:55:54 +00:00
|
|
|
agencyModeFk: 1,
|
|
|
|
warehouseFk: 1
|
2018-05-16 06:13:39 +00:00
|
|
|
};
|
2018-08-17 06:41:30 +00:00
|
|
|
let result = await app.models.Sale.priceDifference(1, data);
|
|
|
|
|
2018-09-21 13:01:51 +00:00
|
|
|
expect(result.totalUnitPrice).toEqual(22.33);
|
2018-09-11 13:09:15 +00:00
|
|
|
expect(result.totalNewPrice).toEqual(22.33);
|
2018-09-21 13:01:51 +00:00
|
|
|
expect(result.totalDifference).toEqual(0);
|
2018-05-16 06:13:39 +00:00
|
|
|
});
|
|
|
|
});
|