23 lines
652 B
JavaScript
23 lines
652 B
JavaScript
const models = require('vn-loopback/server/server').models;
|
|
|
|
describe('ticket-request deny()', () => {
|
|
it('should return the dinied ticket request', async() => {
|
|
const tx = await models.TicketRequest.beginTransaction({});
|
|
|
|
try {
|
|
const options = {transaction: tx};
|
|
|
|
const ctx = {req: {accessToken: {userId: 9}}, args: {id: 4, observation: 'my observation'}};
|
|
|
|
const result = await models.TicketRequest.deny(ctx, options);
|
|
|
|
expect(result.id).toEqual(4);
|
|
|
|
await tx.rollback();
|
|
} catch (e) {
|
|
await tx.rollback();
|
|
throw e;
|
|
}
|
|
});
|
|
});
|