salix/modules/ticket/back/methods/sale/specs/getClaimableFromTicket.spec.js

22 lines
677 B
JavaScript
Raw Normal View History

const models = require('vn-loopback/server/server').models;
describe('sale getClaimableFromTicket()', () => {
2019-01-10 06:26:10 +00:00
it('should return the claimable sales of a given ticket', async() => {
const tx = await models.Sale.beginTransaction({});
try {
const options = {transaction: tx};
const claimableFromTicket = await models.Sale.getClaimableFromTicket(16, options);
expect(claimableFromTicket[0].concept).toBe('Ranged weapon longbow 2m');
expect(claimableFromTicket.length).toBe(3);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});