Skip to content

Commit

Permalink
[Tests] Fix les tests e2e (#1415)
Browse files Browse the repository at this point in the history
  • Loading branch information
claire2212 committed May 28, 2024
2 parents 9f2e857 + bdc991c commit 55ab020
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => (
<ThemesAndSubThemesContainer key={content.title} data-cy="cell-envActions-themes" title={cellTitle}>
{content.component}
? cellContent.map(({ component, title }, index) => (
<ThemesAndSubThemesContainer key={title} data-cy="cell-envActions-themes" title={cellTitle}>
{component}
{index < cellContent.length - 1 ? ' - ' : ''}
</ThemesAndSubThemesContainer>
))
Expand Down

0 comments on commit 55ab020

Please sign in to comment.