From 03af680968d793658d19fdea97e70160b32cec1b Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Wed, 18 Dec 2019 07:30:24 +0100 Subject: [PATCH] fix backtest --- .../back/methods/invoiceOut/specs/book.spec.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/book.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/book.spec.js index 345e29125..fece307de 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/book.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/book.spec.js @@ -2,13 +2,16 @@ const app = require('vn-loopback/server/server'); describe('invoiceOut book()', () => { const invoiceOutId = 1; - let invoiceOutRef; + let bookedDate; let OriginalInvoiceOut; let updatedInvoiceOut; - let bookedDate; afterAll(async done => { - updatedInvoiceOut.updateAttributes({booked: OriginalInvoiceOut.booked, hasPdf: OriginalInvoiceOut.hasPdf}); + updatedInvoiceOut.updateAttributes({ + booked: OriginalInvoiceOut.booked, + hasPdf: OriginalInvoiceOut.hasPdf, + amount: OriginalInvoiceOut.amount + }); done(); }); @@ -24,7 +27,7 @@ describe('invoiceOut book()', () => { it(`should confirm the book property have been updated`, async() => { OriginalInvoiceOut = await app.models.InvoiceOut.findById(invoiceOutId); - invoiceOutRef = OriginalInvoiceOut.ref; + let invoiceOutRef = OriginalInvoiceOut.ref; await app.models.InvoiceOut.book(invoiceOutRef);