From e23c17504f5c14692309a1ce0b4053b589c33949 Mon Sep 17 00:00:00 2001 From: Maxime Perrault Date: Thu, 12 Dec 2024 18:08:59 +0100 Subject: [PATCH] fix: test e2e --- .../e2e/main_window/control_unit_dialog/contact_list.spec.ts | 2 +- frontend/cypress/e2e/side_window/mission_list/filters.spec.ts | 2 +- frontend/cypress/e2e/side_window/mission_list/missions.spec.ts | 2 +- frontend/cypress/e2e/side_window/reporting/filters.spec.ts | 2 +- .../e2e/side_window/vigilance_areas_list/filters.spec.ts | 2 +- .../src/features/commonComponents/ReinitializeFiltersButton.tsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/cypress/e2e/main_window/control_unit_dialog/contact_list.spec.ts b/frontend/cypress/e2e/main_window/control_unit_dialog/contact_list.spec.ts index fde0f99575..7ed2c5d965 100644 --- a/frontend/cypress/e2e/main_window/control_unit_dialog/contact_list.spec.ts +++ b/frontend/cypress/e2e/main_window/control_unit_dialog/contact_list.spec.ts @@ -152,7 +152,7 @@ context('Main Window > Control Unit Dialog > Contact List', () => { cy.contains('Unité DREAL Pays-de-La-Loire').should('be.visible') - cy.getDataCy('reinitialize-filters').scrollIntoView().click() + cy.clickButton('Réinitialiser les filtres') }) it('Should open the current mission of the unit', () => { diff --git a/frontend/cypress/e2e/side_window/mission_list/filters.spec.ts b/frontend/cypress/e2e/side_window/mission_list/filters.spec.ts index 1c8dfe7a57..dba18674bc 100644 --- a/frontend/cypress/e2e/side_window/mission_list/filters.spec.ts +++ b/frontend/cypress/e2e/side_window/mission_list/filters.spec.ts @@ -9,7 +9,7 @@ context('Side Window > Mission List > Filter Bar', () => { }) afterEach(() => { - cy.getDataCy('reinitialize-filters').scrollIntoView().click() + cy.clickButton('Réinitialiser les filtres') }) it('Should filter missions for the current week', () => { diff --git a/frontend/cypress/e2e/side_window/mission_list/missions.spec.ts b/frontend/cypress/e2e/side_window/mission_list/missions.spec.ts index 69b63c6971..7e004f2736 100644 --- a/frontend/cypress/e2e/side_window/mission_list/missions.spec.ts +++ b/frontend/cypress/e2e/side_window/mission_list/missions.spec.ts @@ -33,7 +33,7 @@ context('Missions', () => { cy.getDataCy('edit-mission-48').should('not.exist') cy.log('Initialize filters') - cy.getDataCy('reinitialize-filters').click() + cy.clickButton('Réinitialiser les filtres') cy.getDataCy('edit-mission-48').scrollIntoView().should('exist') cy.log('Units should be filtered') diff --git a/frontend/cypress/e2e/side_window/reporting/filters.spec.ts b/frontend/cypress/e2e/side_window/reporting/filters.spec.ts index 7ac4d66876..d5f8806db6 100644 --- a/frontend/cypress/e2e/side_window/reporting/filters.spec.ts +++ b/frontend/cypress/e2e/side_window/reporting/filters.spec.ts @@ -10,7 +10,7 @@ context('Reportings', () => { cy.wait('@getReportings') }) afterEach(() => { - cy.getDataCy('reinitialize-filters').click({ force: true }) + cy.clickButton('Réinitialiser les filtres') }) it('Should filter reportings for the last seven days', () => { diff --git a/frontend/cypress/e2e/side_window/vigilance_areas_list/filters.spec.ts b/frontend/cypress/e2e/side_window/vigilance_areas_list/filters.spec.ts index 82c1573f1e..bae3e0839e 100644 --- a/frontend/cypress/e2e/side_window/vigilance_areas_list/filters.spec.ts +++ b/frontend/cypress/e2e/side_window/vigilance_areas_list/filters.spec.ts @@ -6,7 +6,7 @@ context('Side Window > Vigilance Areas List > Filter Bar', () => { }) afterEach(() => { - cy.getDataCy('reinitialize-filters').scrollIntoView().click() + cy.clickButton('Réinitialiser les filtres') }) const verifyVigilanceAreaRows = (expectedText: string) => { diff --git a/frontend/src/features/commonComponents/ReinitializeFiltersButton.tsx b/frontend/src/features/commonComponents/ReinitializeFiltersButton.tsx index 188f988daf..fe466a127e 100644 --- a/frontend/src/features/commonComponents/ReinitializeFiltersButton.tsx +++ b/frontend/src/features/commonComponents/ReinitializeFiltersButton.tsx @@ -7,7 +7,7 @@ interface ReinitializeFiltersButtonProps { export function ReinitializeFiltersButton({ onClick }: ReinitializeFiltersButtonProps) { return ( - + Réinitialiser les filtres