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

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