From 70c2f6b2b06a779aed5fcf1067579af3cac71541 Mon Sep 17 00:00:00 2001 From: jtubau Date: Wed, 26 Feb 2025 12:33:35 +0100 Subject: [PATCH] refactor: refs #8594 update vehicle summary tests to use expected variable for consistency --- test/cypress/integration/route/vehicle/vehicleList.spec.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/cypress/integration/route/vehicle/vehicleList.spec.js b/test/cypress/integration/route/vehicle/vehicleList.spec.js index e633b2fa2e5..2b3c9cdbc27 100644 --- a/test/cypress/integration/route/vehicle/vehicleList.spec.js +++ b/test/cypress/integration/route/vehicle/vehicleList.spec.js @@ -17,6 +17,7 @@ describe('Vehicle list', () => { Description: { val: 'Exclusive for batpod transport' }, }; + const expected = data['Nº Plate'].val; const summaryUrl = '/summary'; beforeEach(() => { @@ -39,19 +40,19 @@ describe('Vehicle list', () => { cy.dataCy(selectors.saveFormBtn).should('be.visible').click(); cy.checkNotification('Data created'); - cy.get(selectors.summaryHeader).should('contain', data['Nº Plate'].val); + cy.get(selectors.summaryHeader).should('contain', expected); cy.url().should('include', summaryUrl); }); it('should open summary by clicking a vehicle', () => { cy.get(selectors.numberPlate).click(); - cy.get(selectors.summaryHeader).should('contain', data['Nº Plate'].val); + cy.get(selectors.summaryHeader).should('contain', expected); cy.url().should('include', summaryUrl); }); it('should redirect to vehicle summary when click summary icon on summary pop-up', () => { cy.get(selectors.summaryPopupBtn).click(); - cy.get(selectors.summaryHeader).should('contain', data['Nº Plate'].val); + cy.get(selectors.summaryHeader).should('contain', expected); cy.get(selectors.summaryGoToSummaryBtn).click(); cy.url().should('include', summaryUrl); });