fix: backTest
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2022-09-22 13:55:09 +02:00
parent 95e5b1a970
commit a486b1593b
1 changed files with 13 additions and 1 deletions

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);
});