From 30fedfc6bccf5df617ae30452566dbda05bf8461 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Feb 2024 03:41:49 +0100 Subject: [PATCH] Fix sea control e2e tests --- .../mission_form/sea_control.spec.ts | 21 +++++-------------- frontend/package-lock.json | 8 +++---- frontend/package.json | 2 +- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/frontend/cypress/e2e/side_window/mission_form/sea_control.spec.ts b/frontend/cypress/e2e/side_window/mission_form/sea_control.spec.ts index 9dc735b7e3..dd1fbf35ec 100644 --- a/frontend/cypress/e2e/side_window/mission_form/sea_control.spec.ts +++ b/frontend/cypress/e2e/side_window/mission_form/sea_control.spec.ts @@ -95,8 +95,8 @@ context('Side Window > Mission Form > Sea Control', () => { // Engins à bord cy.fill('Ajouter un engin', 'MIS') cy.fill('Engin contrôlé', 'Oui') - cy.fill('Maillage déclaré', '10') - cy.fill('Maillage mesuré', '20') + cy.fill('Maillage déclaré', 10) + cy.fill('Maillage mesuré', 20) // This will modify the "Maillage mesuré" input as `undefined` cy.fill('Maillage non mesuré', true) cy.fill('MIS : autres mesures et dispositifs', 'Autres mesures.') @@ -494,11 +494,6 @@ context('Side Window > Mission Form > Sea Control', () => { cy.clickButton("Éditer l'infraction") cy.fill('Résultat de l’infraction', 'Sans PV') - // Click the "X" button in the NATINF tag - cy.contains('23581 - Taille de maille non réglementaire') - .parentsUntil('.rs-picker-toggle') - .find('.rs-picker-toggle-clean') - .forceClick() cy.fill('NATINF', '23588') cy.fill('Observations sur l’infraction', "Une autre observation sur l'infraction") @@ -727,8 +722,7 @@ context('Side Window > Mission Form > Sea Control', () => { // Main Form // Add a PAM control unit - cy.get('span[role="button"][title="Clear"]').eq(0).click({ force: true }) - cy.get('span[role="button"][title="Clear"]').eq(1).click({ force: true }) + cy.fill('Administration 1', undefined) cy.fill('Unité 1', 'PAM Jeanne Barret') // ------------------------------------------------------------------------- @@ -748,12 +742,8 @@ context('Side Window > Mission Form > Sea Control', () => { cy.wait(500) // Remove the PAM control unit - cy.get('span[role="button"][title="Clear"]').eq(0).click({ force: true }) - cy.wait(500) - cy.get('span[role="button"][title="Clear"]').eq(1).click({ force: true }) - cy.wait(500) + cy.fill('Administration 1', undefined) cy.fill('Unité 1', 'Cultures marines 56') - cy.wait(500) cy.get('legend') .filter(':contains("Autre(s) contrôle(s) effectué(s) par l’unité sur le navire")') @@ -806,8 +796,7 @@ context('Side Window > Mission Form > Sea Control', () => { .should('have.length', 0) // Add a PAM control unit - cy.get('span[role="button"][title="Clear"]').eq(0).click({ force: true }) - cy.get('span[role="button"][title="Clear"]').eq(1).click({ force: true }) + cy.fill('Administration 1', undefined) cy.fill('Unité 1', 'PAM Jeanne Barret') // ------------------------------------------------------------------------- diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 8bbc0b5952..64705fbed9 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@dnd-kit/core": "6.1.0", "@dnd-kit/modifiers": "6.0.1", - "@mtes-mct/monitor-ui": "12.1.0", + "@mtes-mct/monitor-ui": "12.1.1", "@reduxjs/toolkit": "1.9.6", "@sentry/browser": "7.55.2", "@sentry/react": "7.52.1", @@ -2866,9 +2866,9 @@ "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA==" }, "node_modules/@mtes-mct/monitor-ui": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/@mtes-mct/monitor-ui/-/monitor-ui-12.1.0.tgz", - "integrity": "sha512-cbnfTISEEll8JDpizcC/Vo1CXLPOCgnIm60kLDZJ1qQN+g+5cQ+WYvSz90MvLMmY1cj6XS4Ls/dLiDjOEUuf7Q==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@mtes-mct/monitor-ui/-/monitor-ui-12.1.1.tgz", + "integrity": "sha512-nXqED7/r0eklNnsbFOyZ66FAEbG7hsmfO0mpoq4fNE+4O5nF38JqKbYhPisYvsyzLCp81HfsSni0B8K82O7V3Q==", "dependencies": { "@babel/runtime": "7.22.15", "@tanstack/react-table": "8.9.7", diff --git a/frontend/package.json b/frontend/package.json index ad4639aba3..e951f51ec0 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -35,7 +35,7 @@ "dependencies": { "@dnd-kit/core": "6.1.0", "@dnd-kit/modifiers": "6.0.1", - "@mtes-mct/monitor-ui": "12.1.0", + "@mtes-mct/monitor-ui": "12.1.1", "@reduxjs/toolkit": "1.9.6", "@sentry/browser": "7.55.2", "@sentry/react": "7.52.1",