From bdc991c2cb8e6f737085dab87a8480bf974193a3 Mon Sep 17 00:00:00 2001 From: Claire Dagan Date: Tue, 28 May 2024 09:51:37 +0200 Subject: [PATCH] [Tests] fix test e2e --- .../db/testdata/V666.10__insert_dummy_env_actions.sql | 6 +++--- .../attach_actions_to_reportings_in_mission.spec.ts | 4 ++-- .../src/features/missions/MissionsList/CellActionThemes.tsx | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/src/main/resources/db/testdata/V666.10__insert_dummy_env_actions.sql b/backend/src/main/resources/db/testdata/V666.10__insert_dummy_env_actions.sql index b1c669ed62..011bc9b35b 100644 --- a/backend/src/main/resources/db/testdata/V666.10__insert_dummy_env_actions.sql +++ b/backend/src/main/resources/db/testdata/V666.10__insert_dummy_env_actions.sql @@ -17,9 +17,9 @@ INSERT INTO public.env_actions (id, mission_id, action_type, value, action_start INSERT INTO public.env_actions VALUES -('2cdcd429-19ab-45ed-a892-7c695bd256e2', 53, 'SURVEILLANCE', '{"themes": [{"theme": "Pêche de loisir", "subThemes": ["Pêche embarquée"], "protectedSpecies": []}], "duration": 0.0, "observations": "RAS", "protectedSpecies": []}', '2022-11-21 14:29:55.588693', NULL, NULL, NULL, '2022-11-22 12:14:48.588693', NULL, NULL, NULL, NULL, 'TO_COMPLETE','ABC', 'DEF'), -('3480657f-7845-4eb4-aa06-07b174b1da45', 53, 'CONTROL', '{"themes": [{"theme": "Police des mouillages", "subThemes": ["Mouillage individuel", "ZMEL"], "protectedSpecies": []}], "observations": "RAS", "infractions": [], "vehicleType": "VESSEL", "actionTargetType": "VEHICLE", "actionNumberOfControls": 0}', '2022-11-22 10:14:48.588693', '0104000020E610000001000000010100000047A07E6651E3DEBF044620AB65C54840', NULL, NULL, NULL, NULL, NULL, NULL, NULL,'TO_COMPLETE', 'ABC', 'DEF'), -('9969413b-b394-4db4-985f-b00743ffb833', 53, 'SURVEILLANCE', '{"themes": [{"theme": "Police des espèces protégées et de leurs habitats (faune et flore)", "subThemes": ["Destruction, capture, arrachage", "Atteinte aux habitats d''espèces protégées"], "protectedSpecies": ["FLORA", "BIRDS"]}, {"theme": "Police des mouillages", "subThemes": ["Mouillage individuel", "ZMEL"], "protectedSpecies": []}], "duration": 0.0, "observations": "RAS", "protectedSpecies": []}', '2022-11-21 15:29:55.588693', NULL, NULL, NULL, '2022-11-22 13:14:48.588693', NULL, NULL, NULL, NULL,'TO_COMPLETE', 'ABC', 'DEF') +('2cdcd429-19ab-45ed-a892-7c695bd256e2', 53, 'SURVEILLANCE', '{"observations": "RAS"}', '2022-11-21 14:29:55.588693', NULL, NULL, NULL, '2022-11-22 12:14:48.588693', NULL, NULL, NULL, NULL, 'TO_COMPLETE','ABC', 'DEF'), +('3480657f-7845-4eb4-aa06-07b174b1da45', 53, 'CONTROL', '{"observations": "RAS", "infractions": [], "vehicleType": "VESSEL", "actionTargetType": "VEHICLE", "actionNumberOfControls": 0}', '2022-11-22 10:14:48.588693', '0104000020E610000001000000010100000047A07E6651E3DEBF044620AB65C54840', NULL, NULL, NULL, NULL, NULL, NULL, NULL,'TO_COMPLETE', 'ABC', 'DEF'), +('9969413b-b394-4db4-985f-b00743ffb833', 53, 'SURVEILLANCE', '{"observations": "RAS", "protectedSpecies": []}', '2022-11-21 18:29:55.588693', NULL, NULL, NULL, '2022-11-22 13:14:48.588693', NULL, NULL, NULL, NULL,'TO_COMPLETE', 'ABC', 'DEF') ; UPDATE public.env_actions SET diff --git a/frontend/cypress/e2e/side_window/mission_form/attach_actions_to_reportings_in_mission.spec.ts b/frontend/cypress/e2e/side_window/mission_form/attach_actions_to_reportings_in_mission.spec.ts index 4beb89fb9d..dc0bb5c8aa 100644 --- a/frontend/cypress/e2e/side_window/mission_form/attach_actions_to_reportings_in_mission.spec.ts +++ b/frontend/cypress/e2e/side_window/mission_form/attach_actions_to_reportings_in_mission.spec.ts @@ -86,7 +86,7 @@ context('Side Window > Mission Form > Attach action to reporting', () => { cy.intercept('GET', '/bff/v1/missions*').as('getMissions') cy.wait(400) cy.getDataCy('edit-mission-53').click({ force: true }) - cy.getDataCy('action-card').eq(2).click() + cy.getDataCy('action-card').eq(1).click() cy.intercept('PUT', `/bff/v1/missions/53`).as('updateMission') cy.wait(250) @@ -115,7 +115,7 @@ context('Side Window > Mission Form > Attach action to reporting', () => { cy.wait(400) cy.getDataCy('edit-mission-53').click({ force: true }) - cy.getDataCy('action-card').eq(2).click() + cy.getDataCy('action-card').eq(1).click() cy.wait(200) cy.getDataCy('surveillance-form-toggle-reporting').click({ force: true }) cy.wait(200) diff --git a/frontend/src/features/missions/MissionsList/CellActionThemes.tsx b/frontend/src/features/missions/MissionsList/CellActionThemes.tsx index 4262a2c9e7..7471e48a6e 100644 --- a/frontend/src/features/missions/MissionsList/CellActionThemes.tsx +++ b/frontend/src/features/missions/MissionsList/CellActionThemes.tsx @@ -63,9 +63,9 @@ export function CellActionThemes({ envActions }: { envActions: EnvAction[] }) { const cellTitle = useMemo(() => cellContent?.map(content => content.title).join(' - '), [cellContent]) return cellContent?.length > 0 - ? cellContent.map((content, index) => ( - - {content.component} + ? cellContent.map(({ component, title }, index) => ( + + {component} {index < cellContent.length - 1 ? ' - ' : ''} ))