4369-ticket.request.create_getItemTypeWorker #1061
|
@ -1,8 +1,20 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('ticket-request getItemTypeWorker()', () => {
|
||||
const ctx = {req: {accessToken: {userId: 18}}};
|
||||
|
||||
it('should return the buyer as result', async() => {
|
||||
const filter = {where: {firstName: 'buyer'}};
|
||||
|
||||
const result = await models.TicketRequest.getItemTypeWorker(ctx, filter);
|
||||
|
||||
expect(result.length).toEqual(1);
|
||||
});
|
||||
|
||||
it('should return the workers at itemType as result', async() => {
|
||||
const result = await models.TicketRequest.getItemTypeWorker();
|
||||
const filter = {};
|
||||
|
||||
const result = await models.TicketRequest.getItemTypeWorker(ctx, filter);
|
||||
|
||||
expect(result.length).toEqual(2);
|
||||
vicent marked this conversation as resolved
Outdated
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
En vez de contabilizar el número exacto, conviene comprobar que devuelva más de un resultado.