2018-05-16 06:13:39 +00:00
|
|
|
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 => {
|
|
|
|
let data = {
|
|
|
|
landed: Date.now(),
|
|
|
|
addressFk: 121,
|
2018-05-30 08:55:54 +00:00
|
|
|
agencyModeFk: 1,
|
|
|
|
warehouseFk: 1
|
2018-05-16 06:13:39 +00:00
|
|
|
};
|
|
|
|
app.models.Sale.priceDifference(1, data)
|
|
|
|
.catch(response => {
|
|
|
|
expect(response).toEqual(new Error('ER_SIGNAL_EXCEPTION: NO_AGENCY_AVAILABLE'));
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|