aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/design-system
diff options
context:
space:
mode:
authorJeremy Davis <jeremy.davis@sonarsource.com>2024-09-02 15:22:59 +0200
committersonartech <sonartech@sonarsource.com>2024-09-04 20:03:11 +0000
commitbed8af05f0c3f2b4c6018634d3d7aaba5b45a83c (patch)
tree35bbc62677b27265d1e6a51a2adeebeadce528cd /server/sonar-web/design-system
parenta4e8edf67e1ea2aba973a88162d2837dad0a4831 (diff)
downloadsonarqube-bed8af05f0c3f2b4c6018634d3d7aaba5b45a83c.tar.gz
sonarqube-bed8af05f0c3f2b4c6018634d3d7aaba5b45a83c.zip
SONAR-22941 Update RTL and related deps
Diffstat (limited to 'server/sonar-web/design-system')
-rw-r--r--server/sonar-web/design-system/package.json4
-rw-r--r--server/sonar-web/design-system/src/sonar-aligned/components/input/SelectCommon.tsx6
2 files changed, 7 insertions, 3 deletions
diff --git a/server/sonar-web/design-system/package.json b/server/sonar-web/design-system/package.json
index 33aa253317c..a237ff598ca 100644
--- a/server/sonar-web/design-system/package.json
+++ b/server/sonar-web/design-system/package.json
@@ -25,8 +25,8 @@
"@emotion/babel-plugin-jsx-pragmatic": "0.2.1",
"@sonarsource/echoes-react": "0.6.0",
"@testing-library/dom": "10.2.0",
- "@testing-library/jest-dom": "6.4.6",
- "@testing-library/react": "16.0.0",
+ "@testing-library/jest-dom": "6.5.0",
+ "@testing-library/react": "16.0.1",
"@testing-library/user-event": "14.5.2",
"@types/d3-array": "3.2.1",
"@types/d3-hierarchy": "~3.1.7",
diff --git a/server/sonar-web/design-system/src/sonar-aligned/components/input/SelectCommon.tsx b/server/sonar-web/design-system/src/sonar-aligned/components/input/SelectCommon.tsx
index 8414e6f3b79..8e89171aeb7 100644
--- a/server/sonar-web/design-system/src/sonar-aligned/components/input/SelectCommon.tsx
+++ b/server/sonar-web/design-system/src/sonar-aligned/components/input/SelectCommon.tsx
@@ -61,9 +61,13 @@ export function IconOption<
const { label, isSelected } = props;
const { Icon } = props.data as { Icon: JSX.Element };
+ // For tests and a11y
+ props.innerProps.role = 'option';
+ props.innerProps['aria-selected'] = isSelected;
+
return (
<components.Option {...props}>
- <div aria-selected={isSelected} className="sw-flex sw-items-center sw-gap-1" role="option">
+ <div className="sw-flex sw-items-center sw-gap-1">
{Icon}
<SearchHighlighter>{label}</SearchHighlighter>
</div>