fix: backTest
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
9f70a1d513
commit
f95f977b69
|
@ -10,7 +10,6 @@ describe('InvoiceOut globalInvoicing()', () => {
|
||||||
minShipped.setMonth(1);
|
minShipped.setMonth(1);
|
||||||
minShipped.setDate(1);
|
minShipped.setDate(1);
|
||||||
minShipped.setHours(0, 0, 0, 0);
|
minShipped.setHours(0, 0, 0, 0);
|
||||||
const invoicedTicketId = 8;
|
|
||||||
const invoiceSerial = 'A';
|
const invoiceSerial = 'A';
|
||||||
const activeCtx = {
|
const activeCtx = {
|
||||||
accessToken: {userId: userId},
|
accessToken: {userId: userId},
|
||||||
|
@ -35,11 +34,14 @@ describe('InvoiceOut globalInvoicing()', () => {
|
||||||
companyFk: companyFk,
|
companyFk: companyFk,
|
||||||
minShipped: minShipped
|
minShipped: minShipped
|
||||||
};
|
};
|
||||||
const result = await models.InvoiceOut.globalInvoicing(ctx, options);
|
const invoiceOutId = await models.InvoiceOut.globalInvoicing(ctx, options);
|
||||||
const ticket = await models.Ticket.findById(invoicedTicketId, null, 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(invoiceOutId).toBeGreaterThan(0);
|
||||||
expect(ticket.refFk).toContain(invoiceSerial);
|
expect(firstTicket.refFk).toContain(invoiceSerial);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue