2018-12-21 11:50:28 +00:00
|
|
|
const app = require(`${serviceRoot}/server/server`);
|
2018-10-02 07:52:38 +00:00
|
|
|
|
|
|
|
describe('Claim importTicketSales()', () => {
|
|
|
|
let claimEnds;
|
|
|
|
|
2018-12-21 11:50:28 +00:00
|
|
|
afterAll(async () => {
|
2018-10-02 07:52:38 +00:00
|
|
|
claimEnds.forEach(async line => {
|
|
|
|
await line.destroy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-12-21 11:50:28 +00:00
|
|
|
it('should import sales to a claim actions from an specific ticket', async () => {
|
2018-10-02 07:52:38 +00:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|