fix: backTest
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2022-10-18 10:04:53 +02:00
parent 9f70a1d513
commit f95f977b69
1 changed files with 7 additions and 5 deletions

View File

@ -10,7 +10,6 @@ describe('InvoiceOut globalInvoicing()', () => {
minShipped.setMonth(1);
minShipped.setDate(1);
minShipped.setHours(0, 0, 0, 0);
const invoicedTicketId = 8;
const invoiceSerial = 'A';
const activeCtx = {
accessToken: {userId: userId},
@ -35,11 +34,14 @@ describe('InvoiceOut globalInvoicing()', () => {
companyFk: companyFk,
minShipped: minShipped
};
const result = await models.InvoiceOut.globalInvoicing(ctx, options);
const ticket = await models.Ticket.findById(invoicedTicketId, null, options);
const invoiceOutId = await models.InvoiceOut.globalInvoicing(ctx, options);
const invoiceOut = await models.InvoiceOut.findById(invoiceOutId, null, options);
const [firstTicket] = await models.Ticket.find({
where: {refFk: invoiceOut.ref}
}, options);
expect(result).toBeGreaterThan(0);
expect(ticket.refFk).toContain(invoiceSerial);
expect(invoiceOutId).toBeGreaterThan(0);
expect(firstTicket.refFk).toContain(invoiceSerial);
await tx.rollback();
} catch (e) {