-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Signalements] Le tri de la liste ne fonctionne plus (#2367)
## Linked issues - Resolve #2338 ---- - [x] Tests E2E (Cypress)
- Loading branch information
Showing
14 changed files
with
111 additions
and
45 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
frontend/cypress/e2e/side_window/reporting_list/table.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { openSideWindowReportingList } from './utils' | ||
import { SeaFrontGroup } from '../../../../src/domain/entities/seaFront/constants' | ||
|
||
context('Side Window > Reporting List > Table', () => { | ||
beforeEach(() => { | ||
openSideWindowReportingList() | ||
|
||
cy.getDataCy(`side-window-sub-menu-${SeaFrontGroup.NAMO}`).click() | ||
}) | ||
|
||
it('Should sort reportings by title', () => { | ||
// TODO Make a cypress helper to handle semantically-correct tables (via both `<table />` and roles). | ||
const getTitleColumnHeader = () => cy.get('[role="columnheader"]').contains('Titre') | ||
|
||
getTitleColumnHeader().click() | ||
|
||
getTitleColumnHeader().parent().find('svg').should('be.visible') | ||
cy.get('[role="table"] [role="rowgroup"]:last-child() [role="row"]').first().contains('3 milles - Chaluts') | ||
|
||
getTitleColumnHeader().click() | ||
|
||
getTitleColumnHeader().parent().find('svg').should('be.visible') | ||
cy.get('[role="table"] [role="rowgroup"]:last-child() [role="row"]') | ||
.first() | ||
.contains('Suspicion de chalutage dans les 3 milles') | ||
}) | ||
|
||
it('Should sort reportings by NATINF', () => { | ||
const getNatinfColumnHeader = () => cy.get('[role="columnheader"]').contains('NATINF') | ||
|
||
getNatinfColumnHeader().click() | ||
|
||
getNatinfColumnHeader().parent().find('svg').should('be.visible') | ||
cy.get('[role="table"] [role="rowgroup"]:last-child() [role="row"]').first().contains('7059') | ||
|
||
getNatinfColumnHeader().click() | ||
|
||
getNatinfColumnHeader().parent().find('svg').should('be.visible') | ||
cy.get('[role="table"] [role="rowgroup"]:last-child() [role="row"]').first().contains('27689') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export const openSideWindowReportingList = () => { | ||
cy.visit('/side_window') | ||
|
||
cy.wait(500) | ||
|
||
if (document.querySelector('[data-cy="first-loader"]')) { | ||
cy.getDataCy('first-loader').should('not.be.visible') | ||
} | ||
cy.getDataCy('side-window-reporting-tab').click() | ||
|
||
cy.wait(500) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import styled from 'styled-components' | ||
|
||
export const CardTableBody = styled.div` | ||
export const CardTableBody = styled.div.attrs(() => ({ | ||
role: 'rowgroup' | ||
}))` | ||
overflow-y: auto; | ||
max-height: calc(100vh - 170px); | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters