From cfdcd9b2b86f83dd0ef596d140540fd234b383be Mon Sep 17 00:00:00 2001 From: Loup Theron Date: Wed, 29 Jan 2025 15:44:35 +0100 Subject: [PATCH] Fix typo in cypress tests --- .../main_window/vessel_sidebar/reporting.spec.ts | 6 +++--- .../side_window/reporting_list/actions.spec.ts | 16 ++++++++-------- .../components/ReportingTable/index.tsx | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/frontend/cypress/e2e/main_window/vessel_sidebar/reporting.spec.ts b/frontend/cypress/e2e/main_window/vessel_sidebar/reporting.spec.ts index b0e950a5b4..396520040d 100644 --- a/frontend/cypress/e2e/main_window/vessel_sidebar/reporting.spec.ts +++ b/frontend/cypress/e2e/main_window/vessel_sidebar/reporting.spec.ts @@ -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 }) @@ -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', () => { diff --git a/frontend/cypress/e2e/side_window/reporting_list/actions.spec.ts b/frontend/cypress/e2e/side_window/reporting_list/actions.spec.ts index 391a48da37..12218ad54e 100644 --- a/frontend/cypress/e2e/side_window/reporting_list/actions.spec.ts +++ b/frontend/cypress/e2e/side_window/reporting_list/actions.spec.ts @@ -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 @@ -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) }) }) }) @@ -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 @@ -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 @@ -95,7 +95,7 @@ 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) @@ -103,7 +103,7 @@ context('Side Window > Reporting List > Actions', () => { * 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', { @@ -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) }) }) }) diff --git a/frontend/src/features/Reporting/components/ReportingTable/index.tsx b/frontend/src/features/Reporting/components/ReportingTable/index.tsx index c204ff07e9..1405538632 100644 --- a/frontend/src/features/Reporting/components/ReportingTable/index.tsx +++ b/frontend/src/features/Reporting/components/ReportingTable/index.tsx @@ -175,7 +175,7 @@ export function ReportingTable({ isFromUrl, selectedSeafrontGroup }: ReportingTa rowVirtualizer?.measureElement(node)} - data-cy="ReportingList-reporting" + data-cy="ReportingTable-reporting" data-index={virtualRow?.index} > {row?.getVisibleCells().map(cell => (