Merge pull request '#6703 fix test back' (!1997) from 6703-fixTestBack into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1997
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Jorge Penadés 2024-02-05 09:12:52 +00:00
commit b5ad85dbb5
1 changed files with 3 additions and 11 deletions

View File

@ -70,19 +70,11 @@ describe('Ticket cloning - clone function', () => {
it('should create a ticket without sales', async() => {
const servicesIds = [4];
const tx = await models.Sale.beginTransaction({});
const options = {transaction: tx};
try {
const tickets = await models.Sale.clone(ctx, null, servicesIds, false, options);
const refundedTicket = await getTicketRefund(tickets[0].id, options);
expect(refundedTicket).toBeDefined();
const tickets = await models.Sale.clone(ctx, null, servicesIds, false, false, options);
const refundedTicket = await getTicketRefund(tickets[0].id, options);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
expect(refundedTicket).toBeDefined();
});
});