diff --git a/services/loopback/common/methods/sale/specs/priceDifference.spec.js b/services/loopback/common/methods/sale/specs/priceDifference.spec.js index 8f37a479f..fc304cceb 100644 --- a/services/loopback/common/methods/sale/specs/priceDifference.spec.js +++ b/services/loopback/common/methods/sale/specs/priceDifference.spec.js @@ -1,17 +1,17 @@ const app = require(`${servicesDir}/ticket/server/server`); describe('sale priceDifference()', () => { - it('should call the priceDifference method and return a NO_AGENCY_AVAILABLE signal error', done => { + it('should return ticket price differences', async() => { let data = { - landed: Date.now(), + landed: new Date(), addressFk: 121, agencyModeFk: 1, warehouseFk: 1 }; - app.models.Sale.priceDifference(1, data) - .catch(response => { - expect(response).toEqual(new Error('ER_SIGNAL_EXCEPTION: NO_AGENCY_AVAILABLE')); - done(); - }); + 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); }); });