24 lines
673 B
JavaScript
24 lines
673 B
JavaScript
const app = require(`${servicesDir}/claim/server/server`);
|
|
|
|
describe('Claim importTicketSales()', () => {
|
|
let claimEnds;
|
|
|
|
afterAll(async() => {
|
|
claimEnds.forEach(async line => {
|
|
await line.destroy();
|
|
});
|
|
});
|
|
|
|
it('should import sales to a claim actions from an specific ticket', async() => {
|
|
let ctx = {req: {accessToken: {userId: 5}}};
|
|
claimEnds = await app.models.ClaimEnd.importTicketSales(ctx, {
|
|
claimFk: 1,
|
|
ticketFk: 1
|
|
});
|
|
|
|
expect(claimEnds.length).toEqual(4);
|
|
expect(claimEnds[0].saleFk).toEqual(1);
|
|
expect(claimEnds[2].saleFk).toEqual(3);
|
|
});
|
|
});
|