Skip to content

Commit

Permalink
force rerender of checkpickers
Browse files Browse the repository at this point in the history
  • Loading branch information
thoomasbro committed Apr 15, 2024
1 parent d86a435 commit 8c7bc55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions frontend/cypress/e2e/side_window/reporting/filters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ context('Reportings', () => {
})

it('Should filter reportings by themes', () => {
cy.wait(200)
cy.fill('Thématiques', ['Arrêté à visa environnemental'])
cy.getDataCy('reportings-filter-tags').find('.Component-SingleTag > span').contains('Arrêté à visa environnemental')

Expand Down Expand Up @@ -232,10 +233,10 @@ context('Reportings', () => {
cy.wait(500)
cy.wait('@getReportings')

cy.get('*[data-cy="reporting-theme-filter"]').click()
cy.getDataCy('reporting-theme-filter').click()
cy.get('#themes-listbox > div').should('have.length', 34)

cy.get('*[data-cy="reporting-sub-theme-filter"]').click()
cy.getDataCy('reporting-sub-theme-filter').click()
cy.get('#subThemes-listbox > div').should('have.length', 161)
})
})
4 changes: 2 additions & 2 deletions frontend/src/features/Reportings/Filters/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export function TableReportingsFiltersWithRef(
value={targetTypeFilter}
/>
<CheckPicker
key={themesOptions.length}
key={`theme${themesOptions.length}${JSON.stringify(themeFilter)}`}
customSearch={themeCustomSearch}
data-cy="reporting-theme-filter"
isLabelHidden
Expand All @@ -216,7 +216,7 @@ export function TableReportingsFiltersWithRef(
value={themeFilter}
/>
<CheckPicker
key={subThemesOptions.length}
key={`subtheme${subThemesOptions.length}${JSON.stringify(subThemesFilter)}`}
customSearch={subThemeCustomSearch}
data-cy="reporting-sub-theme-filter"
isLabelHidden
Expand Down

0 comments on commit 8c7bc55

Please sign in to comment.