2018-05-16 06:13:39 +00:00
|
|
|
const app = require(`${servicesDir}/ticket/server/server`);
|
|
|
|
|
|
|
|
describe('ticket componentUpdate()', () => {
|
|
|
|
it('should call the componentUpdate method', done => {
|
|
|
|
let data = {
|
|
|
|
agencyModeFk: 1,
|
2018-06-05 10:49:33 +00:00
|
|
|
addressFk: 121,
|
2018-05-16 06:13:39 +00:00
|
|
|
warehouseFk: 1,
|
|
|
|
shipped: Date.now(),
|
|
|
|
landed: Date.now(),
|
2018-05-30 08:55:54 +00:00
|
|
|
hasToBeUnrouted: true,
|
2018-05-16 06:13:39 +00:00
|
|
|
option: 1
|
|
|
|
};
|
2018-05-30 08:55:54 +00:00
|
|
|
let ctx = {req: {accessToken: {userId: 101}}};
|
|
|
|
app.models.Ticket.componentUpdate(1, data, ctx)
|
2018-05-16 06:13:39 +00:00
|
|
|
.catch(response => {
|
|
|
|
expect(response).toEqual(new Error('ER_SIGNAL_EXCEPTION: NO_AGENCY_AVAILABLE'));
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|