Skip to content

Commit

Permalink
[Issue #1886]: Fix duplicate id bug in SearchFilterAccordion (#1924)
Browse files Browse the repository at this point in the history
## Summary
Fixes #1886 

## Changes proposed
- add the query param key to the end of the accordion id to prevent duplicate id a11y issue
  • Loading branch information
rylew1 authored May 6, 2024
1 parent 4cdd702 commit 17bb7fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function SearchFilterAccordion({
title: getAccordionTitle(),
content: getAccordionContent(),
expanded: false,
id: "funding-instrument-filter",
id: `funding-instrument-filter-${queryParamKey}`,
headingLevel: "h4",
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ describe("SearchFilterAccordion", () => {
);

const accordionToggleButton = screen.getByTestId(
"accordionButton_funding-instrument-filter",
"accordionButton_funding-instrument-filter-status",
);
const contentDiv = screen.getByTestId(
"accordionItem_funding-instrument-filter",
"accordionItem_funding-instrument-filter-status",
);
expect(contentDiv).toHaveAttribute("hidden");

Expand Down

1 comment on commit 17bb7fb

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report for ./frontend

St.
Category Percentage Covered / Total
🟢 Statements 83.89% 854/1018
🟡 Branches 64.9% 220/339
🟡 Functions 75.34% 165/219
🟢 Lines 83.89% 797/950

Test suite run success

166 tests passing in 55 suites.

Report generated by 🧪jest coverage report action from 17bb7fb

Please sign in to comment.