From f06723a9192a158bbdff8fb160e664d994692f68 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 23 Sep 2024 11:39:10 +0200 Subject: [PATCH] test: VnLocation --- .../integration/vnComponent/vnLocation.spec.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/cypress/integration/vnComponent/vnLocation.spec.js b/test/cypress/integration/vnComponent/vnLocation.spec.js index 3533a3c1f..15ab53d17 100644 --- a/test/cypress/integration/vnComponent/vnLocation.spec.js +++ b/test/cypress/integration/vnComponent/vnLocation.spec.js @@ -36,20 +36,23 @@ describe('VnLocation', () => { }); it('Fin by postalCode', () => { const postCode = '46600'; + const postCodeLabel = '46600, Valencia(Province one), España'; const firstOption = '[role="listbox"] .q-item:nth-child(1)'; cy.get(inputLocation).click(); cy.get(inputLocation).clear(); cy.get(inputLocation).type(postCode); - cy.get(locationOptions).should('have.length.at.least', 2); + cy.get(locationOptions) + .get(':nth-child(1)') + .should('have.length.at.least', 2); + cy.get( + firstOption.concat(' > .q-item__section > .q-item__label--caption') + ).should('have.text', postCodeLabel); cy.get(firstOption).click(); cy.get('.q-btn-group > .q-btn--standard > .q-btn__content > .q-icon').click(); cy.reload(); cy.waitForElement('.q-form'); - cy.get(inputLocation).should( - 'have.value', - '46600 - Valencia(Province one), España' - ); + cy.get(inputLocation).should('have.value', postCodeLabel); }); it('Create postCode', () => {