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,
|
2019-10-22 11:44:36 +00:00
|
|
|
attenderFk: request.attenderFk,
|
2019-07-25 07:55:09 +00:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|