From beeeedbb8455616e6e0f22bda6801cc0deb71277 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 8 May 2025 10:21:32 +0200 Subject: [PATCH] feat(ExtraCommunity): refs #8105 add data-cy attribute for testing and create integration tests --- src/pages/Travel/ExtraCommunity.vue | 1 + .../integration/travel/ExtraCommunity.spec.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 test/cypress/integration/travel/ExtraCommunity.spec.js diff --git a/src/pages/Travel/ExtraCommunity.vue b/src/pages/Travel/ExtraCommunity.vue index afa0663a8..17c957a50 100644 --- a/src/pages/Travel/ExtraCommunity.vue +++ b/src/pages/Travel/ExtraCommunity.vue @@ -547,6 +547,7 @@ watch(route, () => { }, ]" v-text="col.value" + :data-cy="`extra-community-${col.name}`" /> { + it('Should show travels', () => { + cy.login('logistic'); + cy.visit(`/#/travel/extra-community`); + cy.get('.q-page').should('be.visible'); + }); + + it('Should show travels when user is supplier', () => { + cy.login('petterparker'); + cy.visit(`/#/travel/extra-community`); + cy.get('[data-cy="vnFilterPanelChip_continent"] > .q-chip__icon--remove').click(); + cy.dataCy('extra-community-cargoSupplierNickname').each(($el) => { + cy.wrap($el).should('contain.text', 'The farmer'); + }); + }); +});