22 lines
697 B
JavaScript
22 lines
697 B
JavaScript
const app = require(`${servicesDir}/ticket/server/server`);
|
|
|
|
describe('ticket componentUpdate()', () => {
|
|
it('should call the componentUpdate method', done => {
|
|
let data = {
|
|
agencyModeFk: 1,
|
|
addressFk: 121,
|
|
warehouseFk: 1,
|
|
shipped: Date.now(),
|
|
landed: Date.now(),
|
|
hasToBeUnrouted: true,
|
|
option: 1
|
|
};
|
|
let ctx = {req: {accessToken: {userId: 101}}};
|
|
app.models.Ticket.componentUpdate(1, data, ctx)
|
|
.catch(response => {
|
|
expect(response).toEqual(new Error('ER_SIGNAL_EXCEPTION: NO_AGENCY_AVAILABLE'));
|
|
done();
|
|
});
|
|
});
|
|
});
|