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

18 lines
546 B
JavaScript

const app = require('vn-loopback/server/server');
describe('sale priceDifference()', () => {
it('should return ticket price differences', async() => {
let data = {
landed: new Date(),
addressFk: 121,
agencyModeFk: 1,
warehouseFk: 1
};
let result = await app.models.Sale.priceDifference(1, data);
expect(result.totalUnitPrice).toEqual(22.33);
expect(result.totalNewPrice).toEqual(22.29);
expect(result.totalDifference).toEqual(0.8);
});
});