salix/services/ticket/common/methods/sale-tracking/specs/listSaleTracking.spec.js

23 lines
779 B
JavaScript

const app = require(`${servicesDir}/ticket/server/server`);
describe('ticket listSaleTracking()', () => {
it('should call the listSaleTracking method and return the response', done => {
let filter = {where: {ticketFk: 1}};
app.models.SaleTracking.listSaleTracking(filter)
.then(response => {
expect(response[0].concept).toEqual('Gem of Time');
done();
});
});
it(`should call the listSaleTracking method and return zero if doesn't have lines`, done => {
let filter = {where: {ticketFk: 2}};
app.models.SaleTracking.listSaleTracking(filter)
.then(response => {
expect(response.length).toEqual(0);
done();
});
});
});