27 lines
813 B
JavaScript
27 lines
813 B
JavaScript
const app = require('vn-loopback/server/server');
|
|
|
|
describe('Claim importTicketSales()', () => {
|
|
it('should import sales to a claim actions from an specific ticket', async() => {
|
|
const ctx = {req: {accessToken: {userId: 5}}};
|
|
|
|
const tx = await app.models.Entry.beginTransaction({});
|
|
try {
|
|
const options = {transaction: tx};
|
|
|
|
const claimEnds = await app.models.ClaimEnd.importTicketSales(ctx, {
|
|
claimFk: 1,
|
|
ticketFk: 1
|
|
}, options);
|
|
|
|
expect(claimEnds.length).toEqual(4);
|
|
expect(claimEnds[0].saleFk).toEqual(1);
|
|
expect(claimEnds[2].saleFk).toEqual(3);
|
|
|
|
await tx.rollback();
|
|
} catch (e) {
|
|
await tx.rollback();
|
|
throw e;
|
|
}
|
|
});
|
|
});
|