Skip to content

Commit

Permalink
[Test] update close mission test
Browse files Browse the repository at this point in the history
  • Loading branch information
claire2212 committed Oct 12, 2023
1 parent 137f858 commit d9e78a8
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ context('Mission', () => {

// we fill all the required inputs
cy.fill('Thématique de contrôle', 'Police des espèces protégées')

// TODO understand why `cy.fill` doesn't work here
cy.get('*[data-cy="envaction-subtheme-selector"]').click({ force: true })
cy.get('*[data-cy="envaction-theme-element"]').contains("Perturbation d'animaux").click({ force: true })
cy.get('*[data-cy="envaction-subtheme-selector"]').click('topLeft', { force: true })
cy.fill('Date et heure du contrôle (UTC)', [2023, 10, 11, 12, 12])

cy.get('*[data-cy="point-picker-coordinates"]').should('not.exist')
cy.fill('Nombre total de contrôles', '2')
cy.fill('Type de cible', 'Personne morale')

Expand Down Expand Up @@ -80,6 +78,16 @@ context('Mission', () => {
cy.getDataCy('surveillance-zone-matches-mission').should('have.class', 'rs-checkbox-checked')
cy.get('*[data-cy="mission-errors"]').should('not.exist')

// delete theme to test error
cy.fill('Thématique de surveillance', '')
cy.get('*[data-cy="mission-errors"]').should('exist')

cy.fill('Thématique de surveillance', 'Rejets illicites')
// TODO understand why `cy.fill` doesn't work here
cy.get('*[data-cy="envaction-subtheme-selector"]').click({ force: true })
cy.get('*[data-cy="envaction-theme-element"]').contains('Jet de déchet').click({ force: true })
cy.get('*[data-cy="envaction-subtheme-selector"]').click('topLeft', { force: true })

// Then
cy.intercept('PUT', '/bff/v1/missions').as('createAndCloseMission')
cy.clickButton('Enregistrer et clôturer')
Expand Down

0 comments on commit d9e78a8

Please sign in to comment.