diff options
author | guillaume-peoch-sonarsource <guillaume.peoch@sonarsource.com> | 2022-12-13 10:42:05 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-12-13 20:03:18 +0000 |
commit | 74611681271b8be4f520461e9b230c8886dd29f5 (patch) | |
tree | b8df76044c5b01d39935adb94a9e6e3925199203 /server/sonar-web | |
parent | cae72b1b49abfc394f56e0b5b8df860b669c6083 (diff) | |
download | sonarqube-74611681271b8be4f520461e9b230c8886dd29f5.tar.gz sonarqube-74611681271b8be4f520461e9b230c8886dd29f5.zip |
SONAR-17725 Using incorrect ARIA role "group" for list of buttons
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/App-it.tsx | 13 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/components/controls/ButtonToggle.tsx | 2 |
2 files changed, 4 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/App-it.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/App-it.tsx index d9550498dbc..9dff5dcce8e 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/App-it.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/App-it.tsx @@ -285,21 +285,15 @@ describe('The Project section', () => { await user.click(notDefaultQualityGate); - const projectSelectList = screen.getByRole('group'); // by default it shows "selected" values - expect(within(projectSelectList).getAllByRole('button')).toHaveLength(3); expect(screen.getAllByRole('checkbox')).toHaveLength(2); // change tabs to show deselected projects - await user.click( - within(projectSelectList).getByRole('button', { name: 'quality_gates.projects.without' }) - ); + await user.click(screen.getByRole('button', { name: 'quality_gates.projects.without' })); expect(screen.getAllByRole('checkbox')).toHaveLength(2); // change tabs to show all projects - await user.click( - within(projectSelectList).getByRole('button', { name: 'quality_gates.projects.all' }) - ); + await user.click(screen.getByRole('button', { name: 'quality_gates.projects.all' })); expect(screen.getAllByRole('checkbox')).toHaveLength(4); }); @@ -312,7 +306,6 @@ describe('The Project section', () => { await user.click(notDefaultQualityGate); - const projectSelectList = screen.getByRole('group'); const checkedProjects = screen.getAllByRole('checkbox')[0]; expect(screen.getAllByRole('checkbox')).toHaveLength(2); await user.click(checkedProjects); @@ -325,7 +318,7 @@ describe('The Project section', () => { expect(screen.getAllByRole('checkbox')).toHaveLength(1); // change tabs to show deselected projects - await user.click(within(projectSelectList).getAllByRole('button')[1]); + await user.click(screen.getByRole('button', { name: 'quality_gates.projects.without' })); const uncheckedProjects = screen.getAllByRole('checkbox')[0]; expect(screen.getAllByRole('checkbox')).toHaveLength(3); diff --git a/server/sonar-web/src/main/js/components/controls/ButtonToggle.tsx b/server/sonar-web/src/main/js/components/controls/ButtonToggle.tsx index 6c5ad5477e3..db941a80161 100644 --- a/server/sonar-web/src/main/js/components/controls/ButtonToggle.tsx +++ b/server/sonar-web/src/main/js/components/controls/ButtonToggle.tsx @@ -42,7 +42,7 @@ export default function ButtonToggle(props: ButtonToggleProps) { const { disabled, label, options, value } = props; return ( - <ul aria-label={label} role="group" className="button-toggle"> + <ul aria-label={label} className="button-toggle"> {options.map((option) => ( <li key={option.value.toString()}> <Button |