salix/services/loopback/common/methods/sale/specs/priceDifference.spec.js

18 lines
558 B
JavaScript
Raw Normal View History

const app = require(`${servicesDir}/ticket/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(60.5);
expect(result.totalNewPrice).toEqual(26.12);
expect(result.totalDifference).toEqual(202.80);
});
});