8179-testToMaster #3176

Merged
alexm merged 407 commits from 8179-testToMaster into master 2024-11-12 06:41:52 +00:00
1 changed files with 20 additions and 0 deletions
Showing only changes of commit ccf9dbde8e - Show all commits

View File

@ -113,5 +113,25 @@ describe('ticket setDeleted()', () => {
expect(error.message).not.toContain('Tickets with associated refunds');
});
it('should delete a refund ticket from ticketRefund table', async() => {
const tx = await models.Ticket.beginTransaction({});
try {
const options = {transaction: tx};
const ticketId = 24;
const refundTicket = await models.TicketRefund.findOne({where: {refundTicketFk: ticketId}}, options);
expect(refundTicket).toBeTruthy();
await models.Ticket.setDeleted(ctx, ticketId, options);
const isRemoved = await models.TicketRefund.findOne({where: {refundTicketFk: ticketId}}, options);
expect(isRemoved).toBeNull();
await tx.rollback();
} catch (e) {
await tx.rollback();
}
});
});
});