From bed8af05f0c3f2b4c6018634d3d7aaba5b45a83c Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Mon, 2 Sep 2024 15:22:59 +0200 Subject: SONAR-22941 Update RTL and related deps --- server/sonar-web/design-system/package.json | 4 ++-- .../src/sonar-aligned/components/input/SelectCommon.tsx | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'server/sonar-web/design-system') 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 ( -
+
{Icon} {label}
-- cgit v1.2.3