4369-ticket.request.create_getItemTypeWorker #1061

Merged
joan merged 6 commits from 4369-ticket.request.create_getItemTypeWorker into dev 2022-10-06 11:30:52 +00:00
1 changed files with 13 additions and 1 deletions
Showing only changes of commit a486b1593b - Show all commits

View File

@ -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
Outdated
Review

En vez de contabilizar el número exacto, conviene comprobar que devuelva más de un resultado.

En vez de contabilizar el número exacto, conviene comprobar que devuelva más de un resultado.
});