Skip to content

Commit

Permalink
Fix typo in cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Jan 29, 2025
1 parent ad2d4f4 commit cfdcd9b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ context('Vessel sidebar reporting tab', () => {
cy.get('*[data-cy="side-window-reporting-tab"]').click()
cy.get('[data-cy="side-window-sub-menu-NAMO"]').click()
cy.wait(200)
cy.get('*[data-cy="ReportingList-reporting"]').first().contains('FRAIS AVIS MODE')
cy.get('*[data-cy="ReportingTable-reporting"]').first().contains('FRAIS AVIS MODE')

// Archive the newly created reporting
cy.get('table .rs-checkbox-wrapper').eq(1).click({ force: true })
Expand Down Expand Up @@ -181,12 +181,12 @@ context('Vessel sidebar reporting tab', () => {

// When
cy.get('*[data-cy="vessel-sidebar-archived-reporting"]').should('exist')
cy.get('*[data-cy="vessel-sidebar-reporting-archive-year"]').should('have.length', 6)
cy.get('*[data-cy="vessel-sidebar-reporting-archive-year"]').should('have.length', 4)
cy.clickButton('Afficher plus de signalements')

// Then
cy.wait('@getVesselReportings')
cy.get('*[data-cy="vessel-sidebar-reporting-archive-year"]').should('have.length', 7)
cy.get('*[data-cy="vessel-sidebar-reporting-archive-year"]').should('have.length', 5)
})

it('Reporting Should be deleted', () => {
Expand Down
16 changes: 8 additions & 8 deletions frontend/cypress/e2e/side_window/reporting_list/actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ context('Side Window > Reporting List > Actions', () => {
cy.getDataCy('side-window-sub-menu-NAMO').click()
cy.fill('Observations', false)

cy.getDataCy('VesselReportings-reporting').then($reportingRows => {
cy.getDataCy('ReportingTable-reporting').then($reportingRows => {
const numberOfReportings = $reportingRows.length

// When
Expand All @@ -31,7 +31,7 @@ context('Side Window > Reporting List > Actions', () => {
// Then
assert.deepEqual(archiveInterception.request.body, [createdReportingId])

cy.getDataCy('VesselReportings-reporting').should('have.length', numberOfReportings - 1)
cy.getDataCy('ReportingTable-reporting').should('have.length', numberOfReportings - 1)
})
})
})
Expand All @@ -47,7 +47,7 @@ context('Side Window > Reporting List > Actions', () => {
cy.getDataCy('side-window-sub-menu-NAMO').click()
cy.fill('Observations', false)

cy.getDataCy('VesselReportings-reporting').then($reportingRows => {
cy.getDataCy('ReportingTable-reporting').then($reportingRows => {
const numberOfReportings = $reportingRows.length

// When
Expand All @@ -63,13 +63,13 @@ context('Side Window > Reporting List > Actions', () => {
// Then
assert.deepEqual(archiveInterception.request.body, [createdReportingId])

cy.getDataCy('VesselReportings-reporting').should('have.length', numberOfReportings - 1)
cy.getDataCy('ReportingTable-reporting').should('have.length', numberOfReportings - 1)
})
})
})
})

it('A Reporting Should be edited', () => {
it.only('A Reporting Should be edited', () => {
cy.intercept('PUT', 'bff/v1/reportings/7').as('updateReporting')

// Given
Expand All @@ -95,15 +95,15 @@ context('Side Window > Reporting List > Actions', () => {
})
cy.wait(200)

cy.getDataCy('VesselReportings-reporting').should('have.length.greaterThan', 1)
cy.getDataCy('ReportingTable-reporting').should('have.length.greaterThan', 1)
cy.get('tr:contains("COURANT MAIN PROFESSEUR")').contains('DML 56')
cy.get('tr:contains("COURANT MAIN PROFESSEUR")').contains(23581)

/**
* The reporting type must be modified to OBSERVATION
*/

cy.getDataCy('VesselReportings-reporting').then($reportingRows => {
cy.getDataCy('ReportingTable-reporting').then($reportingRows => {
const numberOfReportings = $reportingRows.length

cy.clickButton('Editer le signalement', {
Expand All @@ -121,7 +121,7 @@ context('Side Window > Reporting List > Actions', () => {
expect(request.body.authorTrigram).contains('LTH')
expect(response && response.statusCode).equal(200)

cy.getDataCy('VesselReportings-reporting').should('have.length', numberOfReportings)
cy.getDataCy('ReportingTable-reporting').should('have.length', numberOfReportings)
})
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function ReportingTable({ isFromUrl, selectedSeafrontGroup }: ReportingTa
<StyledBodyTr
key={virtualRow.key}
ref={node => rowVirtualizer?.measureElement(node)}
data-cy="ReportingList-reporting"
data-cy="ReportingTable-reporting"
data-index={virtualRow?.index}
>
{row?.getVisibleCells().map(cell => (
Expand Down

0 comments on commit cfdcd9b

Please sign in to comment.