Skip to content

Commit

Permalink
Fix sea control e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Feb 28, 2024
1 parent d8c069c commit 30fedfc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 21 deletions.
21 changes: 5 additions & 16 deletions frontend/cypress/e2e/side_window/mission_form/sea_control.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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')

// -------------------------------------------------------------------------
Expand All @@ -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")')
Expand Down Expand Up @@ -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')

// -------------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 30fedfc

Please sign in to comment.