salix/modules/ticket/back/methods/sale-tracking/specs/listSaleTracking.spec.js

18 lines
665 B
JavaScript

const app = require('vn-loopback/server/server');
describe('ticket listSaleTracking()', () => {
it('should call the listSaleTracking method and return the response', async() => {
let filter = {where: {ticketFk: 1}};
let result = await app.models.SaleTracking.listSaleTracking(filter);
expect(result[0].concept).toEqual('Ranged weapon longbow 2m');
});
it(`should call the listSaleTracking method and return zero if doesn't have lines`, async() => {
let filter = {where: {ticketFk: 2}};
let result = await app.models.SaleTracking.listSaleTracking(filter);
expect(result.length).toEqual(0);
});
});