salix/modules/ticket/back/methods/ticket-request/specs/deny.spec.js

26 lines
685 B
JavaScript
Raw Normal View History

2019-07-25 07:55:09 +00:00
const app = require('vn-loopback/server/server');
describe('ticket-request deny()', () => {
let request;
afterAll(async done => {
let params = {
isOk: null,
atenderFk: request.atenderFk,
response: null,
};
await request.updateAttributes(params);
done();
});
it('should return all ticket requests', async() => {
let ctx = {req: {accessToken: {userId: 9}}, args: {id: 4, observation: 'my observation'}};
request = await app.models.TicketRequest.findById(ctx.args.id);
let result = await app.models.TicketRequest.deny(ctx);
expect(result.id).toEqual(4);
});
});