salix/services/loopback/common/methods/ticket/specs/componentUpdate.spec.js

22 lines
697 B
JavaScript
Raw Normal View History

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,
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();
});
});
});