From 4caca33606660668202034b6c89c817c67ed2c90 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 24 Mar 2025 10:44:01 +0100 Subject: [PATCH] fix: refs #8581 update invoiceInSerial test to correctly compare totals after filtering --- .../invoiceIn/invoiceInSerial.spec.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/cypress/integration/invoiceIn/invoiceInSerial.spec.js b/test/cypress/integration/invoiceIn/invoiceInSerial.spec.js index faad22f12..3750f8f06 100644 --- a/test/cypress/integration/invoiceIn/invoiceInSerial.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInSerial.spec.js @@ -10,14 +10,16 @@ describe('InvoiceInSerial', () => { }); it('should filter by last days ', () => { - let before; cy.dataCy('vnTableCell_total') .invoke('text') - .then((total) => (before = +total)); - - cy.dataCy('Last days_input').type('{selectall}1{enter}'); - cy.dataCy('vnTableCell_total') - .invoke('text') - .then((total) => expect(+total).to.be.lessThan(before)); + .then((before) => { + cy.dataCy('Last days_input') + .type('{selectall}1{enter}') + .then(() => { + cy.dataCy('vnTableCell_total') + .invoke('text') + .then((after) => expect(+after).to.be.lessThan(+before)); + }); + }); }); });