24 lines
682 B
JavaScript
24 lines
682 B
JavaScript
const models = require('vn-loopback/server/server').models;
|
|
|
|
describe('ticket-request deny()', () => {
|
|
const ctx = beforeAll.getCtx();
|
|
beforeAll.mockLoopBackContext();
|
|
|
|
it('should return the denied ticket request', async() => {
|
|
const tx = await models.TicketRequest.beginTransaction({});
|
|
|
|
try {
|
|
const options = {transaction: tx};
|
|
ctx.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;
|
|
}
|
|
});
|
|
});
|