From 6ffb62497b285b1168e3b777c42353ffec8fbd9c Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 6 Mar 2025 13:46:56 +0100 Subject: [PATCH] refactor: refs #8606 merged previous and e2e changes and corrected minor errors --- src/pages/Zone/Card/ZoneEventExclusionForm.vue | 3 ++- src/pages/Zone/Card/ZoneEventInclusionForm.vue | 2 -- src/pages/Zone/Card/ZoneEventsPanel.vue | 5 +++-- src/pages/Zone/Card/ZoneLocationsTree.vue | 3 ++- src/pages/Zone/ZoneList.vue | 17 +++++++++++++++++ src/pages/Zone/ZoneUpcoming.vue | 2 +- src/pages/Zone/locale/en.yml | 2 ++ src/pages/Zone/locale/es.yml | 2 ++ .../integration/zone/zoneCalendar.spec.js | 10 ++++------ .../cypress/integration/zone/zoneCreate.spec.js | 2 +- test/cypress/integration/zone/zoneList.spec.js | 2 -- .../integration/zone/zoneLocations.spec.js | 9 ++++++--- .../integration/zone/zoneWarehouse.spec.js | 2 +- 13 files changed, 41 insertions(+), 20 deletions(-) diff --git a/src/pages/Zone/Card/ZoneEventExclusionForm.vue b/src/pages/Zone/Card/ZoneEventExclusionForm.vue index 4b6aa52bd..3828c998f 100644 --- a/src/pages/Zone/Card/ZoneEventExclusionForm.vue +++ b/src/pages/Zone/Card/ZoneEventExclusionForm.vue @@ -171,9 +171,10 @@ onMounted(() => { openConfirmationModal( t('eventsPanel.deleteTitle'), t('eventsPanel.deleteSubtitle'), - () => deleteEvent() + () => deleteEvent(), ) " + data-cy="ZoneEventExclusionDeleteBtn" /> { diff --git a/src/pages/Zone/Card/ZoneEventsPanel.vue b/src/pages/Zone/Card/ZoneEventsPanel.vue index bb8c15934..6b8208026 100644 --- a/src/pages/Zone/Card/ZoneEventsPanel.vue +++ b/src/pages/Zone/Card/ZoneEventsPanel.vue @@ -67,7 +67,7 @@ watch( async () => { await fetchData(); }, - { immediate: true, deep: true } + { immediate: true, deep: true }, ); const formatWdays = (event) => { @@ -178,9 +178,10 @@ onMounted(async () => { openConfirmationModal( t('zone.deleteTitle'), t('zone.deleteSubtitle'), - () => deleteEvent(event.id) + () => deleteEvent(event.id), ) " + data-cy="ZoneEventsPanelDeleteBtn" > {{ t('eventsPanel.delete') }} diff --git a/src/pages/Zone/Card/ZoneLocationsTree.vue b/src/pages/Zone/Card/ZoneLocationsTree.vue index 0654a3ec2..083436440 100644 --- a/src/pages/Zone/Card/ZoneLocationsTree.vue +++ b/src/pages/Zone/Card/ZoneLocationsTree.vue @@ -161,7 +161,8 @@ onUnmounted(() => { :url="url" :redirect="false" :search-remove-params="false" - :label="$t('Search locations')" + :label="$t('zone.searchLocations')" + :info="$t('zone.searchLocationsInfo')" /> { + + es: Search zone: Buscar zona diff --git a/src/pages/Zone/ZoneUpcoming.vue b/src/pages/Zone/ZoneUpcoming.vue index 6fcc00dd2..b8664dc2f 100644 --- a/src/pages/Zone/ZoneUpcoming.vue +++ b/src/pages/Zone/ZoneUpcoming.vue @@ -30,7 +30,7 @@ const columns = computed(() => [ label: t('list.id'), name: 'id', field: 'zoneFk', - align: 'left', + align: 'center', }, ]); diff --git a/src/pages/Zone/locale/en.yml b/src/pages/Zone/locale/en.yml index d72c9f9fd..36f5f63c1 100644 --- a/src/pages/Zone/locale/en.yml +++ b/src/pages/Zone/locale/en.yml @@ -17,6 +17,8 @@ zone: travelingDays: Traveling days search: Search zone searchInfo: Search zone by id or name + searchLocations: Search locations + searchLocationsInfo: Search locations by post code list: clone: Clone id: Id diff --git a/src/pages/Zone/locale/es.yml b/src/pages/Zone/locale/es.yml index 6e005fc0d..777bc1c03 100644 --- a/src/pages/Zone/locale/es.yml +++ b/src/pages/Zone/locale/es.yml @@ -17,6 +17,8 @@ zone: travelingDays: Días de viaje search: Buscar zona searchInfo: Buscar zona por Id o nombre + searchLocations: Buscar localización + searchLocationsInfo: Buscar localización por código postal list: clone: Clonar id: Id diff --git a/test/cypress/integration/zone/zoneCalendar.spec.js b/test/cypress/integration/zone/zoneCalendar.spec.js index d71c29142..07661a17d 100644 --- a/test/cypress/integration/zone/zoneCalendar.spec.js +++ b/test/cypress/integration/zone/zoneCalendar.spec.js @@ -1,20 +1,18 @@ describe('ZoneCalendar', () => { const addEventBtn = '.q-page-sticky > div > .q-btn'; const submitBtn = '.q-mt-lg > .q-btn--standard'; - const deleteBtn = '.q-item__section--side > .q-btn'; - const from = '.q-field__control-container > [data-cy="ZoneEventsFromDate"]'; - const to = '.q-field__control-container > [data-cy="ZoneEventsToDate"]'; + const deleteBtn = '[data-cy="ZoneEventsPanelDeleteBtn"]'; beforeEach(() => { cy.login('developer'); cy.viewport(1920, 1080); - cy.visit(`/#/zone/11/events`); + cy.visit(`/#/zone/13/events`); }); it('should include a one day event, then delete it', () => { cy.get(addEventBtn).click(); cy.dataCy('ZoneEventInclusionDayRadio').click(); - cy.get('.q-card > :nth-child(5)').type('02/04/2001'); + cy.get('.q-card > :nth-child(5)').type('01/01/2001'); cy.get(submitBtn).click(); cy.get(deleteBtn).click(); cy.dataCy('VnConfirm_confirm').click(); @@ -47,7 +45,7 @@ describe('ZoneCalendar', () => { cy.get( '.q-current-day > .q-calendar-month__day--content > [data-cy="ZoneCalendarDay"]', ).click(); - cy.get('.q-mt-lg > :nth-child(2)').click(); + cy.dataCy('ZoneEventExclusionDeleteBtn').click(); cy.dataCy('VnConfirm_confirm').click(); }); }); diff --git a/test/cypress/integration/zone/zoneCreate.spec.js b/test/cypress/integration/zone/zoneCreate.spec.js index 9ef1945bf..fadf5b07f 100644 --- a/test/cypress/integration/zone/zoneCreate.spec.js +++ b/test/cypress/integration/zone/zoneCreate.spec.js @@ -1,4 +1,4 @@ -describe.skip('ZoneCreate', () => { +describe('ZoneCreate', () => { const data = { Name: { val: 'Zone pickup D' }, Price: { val: '3' }, diff --git a/test/cypress/integration/zone/zoneList.spec.js b/test/cypress/integration/zone/zoneList.spec.js index b1b0db3fc..683f4e460 100644 --- a/test/cypress/integration/zone/zoneList.spec.js +++ b/test/cypress/integration/zone/zoneList.spec.js @@ -29,7 +29,5 @@ describe('ZoneList', () => { cy.dataCy('VnConfirm_confirm').click(); cy.url().should('not.include', 'zone/2/'); cy.url().should('match', /zone\/\d+\/basic-data/); - cy.get('.list-box > :nth-child(1)').should('include.text', agency); - cy.get('.title > span').should('include.text', 'Zone pickup B'); }); }); diff --git a/test/cypress/integration/zone/zoneLocations.spec.js b/test/cypress/integration/zone/zoneLocations.spec.js index 04b7f1991..cdc2c778b 100644 --- a/test/cypress/integration/zone/zoneLocations.spec.js +++ b/test/cypress/integration/zone/zoneLocations.spec.js @@ -3,7 +3,8 @@ describe('ZoneLocations', () => { Warehouse: { val: 'Warehouse One', type: 'select' }, }; - const postalCode = '[style=""] > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > .q-tree__node--parent > .q-tree__node-collapsible > .q-tree__children' + const postalCode = + '[style=""] > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > .q-tree__node--parent > .q-tree__node-collapsible > .q-tree__children'; beforeEach(() => { cy.viewport(1280, 720); @@ -12,12 +13,14 @@ describe('ZoneLocations', () => { }); it('should show all locations on entry', () => { - cy.get('.q-tree > :nth-child(1) > :nth-child(2) > :nth-child(1)').children().should('have.length', 9); + cy.get('.q-tree > :nth-child(1) > :nth-child(2) > :nth-child(1)') + .children() + .should('have.length', 9); }); it('should be able to search by postal code', () => { cy.get('#searchbarForm').type('46680'); cy.get('.router-link-active > .q-icon').click(); - cy.get(postalCode).should('include.text', '46680') + cy.get(postalCode).should('include.text', '46680'); }); }); diff --git a/test/cypress/integration/zone/zoneWarehouse.spec.js b/test/cypress/integration/zone/zoneWarehouse.spec.js index b2c1c1ed2..bca5ced22 100644 --- a/test/cypress/integration/zone/zoneWarehouse.spec.js +++ b/test/cypress/integration/zone/zoneWarehouse.spec.js @@ -1,4 +1,4 @@ -describe.skip('ZoneWarehouse', () => { +describe('ZoneWarehouse', () => { const data = { Warehouse: { val: 'Warehouse Two', type: 'select' }, };