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 --- .../js/apps/create/project/__tests__/Azure-it.tsx | 18 ++++++++----- .../apps/create/project/__tests__/Bitbucket-it.tsx | 15 +++++++---- .../create/project/__tests__/BitbucketCloud-it.tsx | 17 +++++++----- .../js/apps/create/project/__tests__/GitHub-it.tsx | 25 +++++++++++------ .../js/apps/create/project/__tests__/GitLab-it.tsx | 22 ++++++++++----- .../project/__tests__/MonorepoProjectCreate-it.tsx | 31 +++++++++++++--------- .../project/components/DopSettingDropdown.tsx | 4 +++ 7 files changed, 86 insertions(+), 46 deletions(-) (limited to 'server/sonar-web/src/main/js/apps/create/project') diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/Azure-it.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/Azure-it.tsx index af0547a00da..358d7db3b8b 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/Azure-it.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/Azure-it.tsx @@ -18,10 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { screen, waitFor } from '@testing-library/react'; - import userEvent from '@testing-library/user-event'; import * as React from 'react'; -import selectEvent from 'react-select-event'; import { byLabelText, byRole, byText } from '~sonar-aligned/helpers/testSelector'; import { searchAzureRepositories } from '../../../../api/alm-integrations'; import AlmIntegrationsServiceMock from '../../../../api/mocks/AlmIntegrationsServiceMock'; @@ -90,7 +88,8 @@ it('should ask for PAT when it is not set yet and show the import project featur expect(await screen.findByText('onboarding.create_project.azure.title')).toBeInTheDocument(); expect(screen.getByText('alm.configuration.selector.label.alm.azure.long')).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-azure-1/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-azure-1/ }).get()); expect(await screen.findByText('onboarding.create_project.enter_pat')).toBeInTheDocument(); expect(screen.getByText('onboarding.create_project.pat_form.title')).toBeInTheDocument(); @@ -112,7 +111,8 @@ it('should show import project feature when PAT is already set', async () => { renderCreateProject(); expect(await screen.findByText('onboarding.create_project.azure.title')).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-azure-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-azure-2/ }).get()); expect(await screen.findByText('Azure project')).toBeInTheDocument(); expect(screen.getByText('Azure project 2')).toBeInTheDocument(); @@ -194,7 +194,8 @@ it('should show search filter when PAT is already set', async () => { renderCreateProject(); expect(await screen.findByText('onboarding.create_project.azure.title')).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-azure-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-azure-2/ }).get()); // Should search with positive results const inputSearch = await screen.findByPlaceholderText( @@ -241,10 +242,13 @@ describe('Azure monorepo setup navigation', () => { }); it('should load every repositories from every projects in monorepo setup mode', async () => { + const user = userEvent.setup(); renderCreateProject({ isMonorepo: true }); - await selectEvent.select(await ui.monorepoDopSettingDropdown.find(), [/conf-azure-2/]); - selectEvent.openMenu(await ui.repositorySelector.find()); + await user.click(await ui.monorepoDopSettingDropdown.find()); + await user.click(byRole('option', { name: /conf-azure-2/ }).get()); + + await user.click(ui.repositorySelector.get()); expect(screen.getByText('Azure repo 1')).toBeInTheDocument(); expect(screen.getByText('Azure repo 2')).toBeInTheDocument(); diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/Bitbucket-it.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/Bitbucket-it.tsx index 72bf92af621..d71369d4d9f 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/Bitbucket-it.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/Bitbucket-it.tsx @@ -21,7 +21,6 @@ import { screen, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; -import selectEvent from 'react-select-event'; import { byLabelText, byRole, byText } from '~sonar-aligned/helpers/testSelector'; import { searchForBitbucketServerRepositories } from '../../../../api/alm-integrations'; import AlmIntegrationsServiceMock from '../../../../api/mocks/AlmIntegrationsServiceMock'; @@ -85,7 +84,9 @@ it('should ask for PAT when it is not set yet and show the import project featur expect(screen.getByText('onboarding.create_project.bitbucket.title')).toBeInTheDocument(); expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-bitbucketserver-1/]); + + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-bitbucketserver-1/ }).get()); expect(await screen.findByText('onboarding.create_project.pat_form.title')).toBeInTheDocument(); @@ -113,7 +114,8 @@ it('should show import project feature when PAT is already set', async () => { expect(screen.getByText('onboarding.create_project.bitbucket.title')).toBeInTheDocument(); expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-bitbucketserver-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-bitbucketserver-2/ }).get()); expect(await screen.findByText('Bitbucket Project 1')).toBeInTheDocument(); @@ -167,7 +169,8 @@ it('should show search filter when PAT is already set', async () => { expect(screen.getByText('onboarding.create_project.bitbucket.title')).toBeInTheDocument(); expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-bitbucketserver-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-bitbucketserver-2/ }).get()); const inputSearch = await screen.findByRole('searchbox', { name: 'onboarding.create_project.search_repositories_by_name', @@ -184,12 +187,14 @@ it('should show search filter when PAT is already set', async () => { }); it('should show no result message when there are no projects', async () => { + const user = userEvent.setup(); almIntegrationHandler.setBitbucketServerProjects([]); renderCreateProject(); expect(screen.getByText('onboarding.create_project.bitbucket.title')).toBeInTheDocument(); expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-bitbucketserver-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-bitbucketserver-2/ }).get()); expect(await screen.findByText('onboarding.create_project.no_bbs_projects')).toBeInTheDocument(); }); diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketCloud-it.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketCloud-it.tsx index e900b099e07..75046e169d1 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketCloud-it.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketCloud-it.tsx @@ -21,7 +21,6 @@ import { screen, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; -import selectEvent from 'react-select-event'; import { byLabelText, byRole, byText } from '~sonar-aligned/helpers/testSelector'; import { searchForBitbucketCloudRepositories } from '../../../../api/alm-integrations'; import AlmIntegrationsServiceMock from '../../../../api/mocks/AlmIntegrationsServiceMock'; @@ -96,7 +95,8 @@ it('should ask for PAT when it is not set yet and show the import project featur expect(screen.getByText('onboarding.create_project.bitbucketcloud.title')).toBeInTheDocument(); expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-bitbucketcloud-1/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-bitbucketcloud-1/ }).get()); expect( await screen.findByText('onboarding.create_project.bitbucket_cloud.enter_password'), @@ -138,7 +138,8 @@ it('should show import project feature when PAT is already set', async () => { expect(screen.getByText('onboarding.create_project.bitbucketcloud.title')).toBeInTheDocument(); expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-bitbucketcloud-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-bitbucketcloud-2/ }).get()); expect(await screen.findByText('BitbucketCloud Repo 1')).toBeInTheDocument(); expect(screen.getByText('BitbucketCloud Repo 2')).toBeInTheDocument(); @@ -184,7 +185,8 @@ it('should show search filter when PAT is already set', async () => { expect(screen.getByText('onboarding.create_project.bitbucketcloud.title')).toBeInTheDocument(); expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-bitbucketcloud-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-bitbucketcloud-2/ }).get()); await waitFor(() => expect(searchForBitbucketCloudRepositories).toHaveBeenLastCalledWith( @@ -212,13 +214,15 @@ it('should show search filter when PAT is already set', async () => { }); it('should show no result message when there are no projects', async () => { + const user = userEvent.setup(); almIntegrationHandler.setBitbucketCloudRepositories([]); renderCreateProject(); expect(screen.getByText('onboarding.create_project.bitbucketcloud.title')).toBeInTheDocument(); expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-bitbucketcloud-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-bitbucketcloud-2/ }).get()); expect( await screen.findByText('onboarding.create_project.bitbucketcloud.no_projects'), @@ -236,7 +240,8 @@ it('should have load more', async () => { expect(screen.getByText('onboarding.create_project.bitbucketcloud.title')).toBeInTheDocument(); expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-bitbucketcloud-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-bitbucketcloud-2/ }).get()); expect(await screen.findByRole('button', { name: 'show_more' })).toBeInTheDocument(); diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/GitHub-it.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/GitHub-it.tsx index e231ed99b3c..2ed43d55d56 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/GitHub-it.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/GitHub-it.tsx @@ -21,7 +21,6 @@ import { screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; -import selectEvent from 'react-select-event'; import { byLabelText, byRole, byText } from '~sonar-aligned/helpers/testSelector'; import { getGithubRepositories } from '../../../../api/alm-integrations'; import AlmIntegrationsServiceMock from '../../../../api/mocks/AlmIntegrationsServiceMock'; @@ -92,25 +91,29 @@ afterAll(() => { }); it('should redirect to github authorization page when not already authorized', async () => { + const user = userEvent.setup(); renderCreateProject('project/create?mode=github'); expect(await screen.findByText('onboarding.create_project.github.title')).toBeInTheDocument(); expect(screen.getByText('alm.configuration.selector.placeholder')).toBeInTheDocument(); expect(ui.instanceSelector.get()).toBeInTheDocument(); - await selectEvent.select(await ui.instanceSelector.find(), [/conf-github-1/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-github-1/ }).get()); expect(window.location.replace).toHaveBeenCalled(); }); it('should not redirect to github when url is malformated', async () => { + const user = userEvent.setup(); renderCreateProject('project/create?mode=github'); expect(await screen.findByText('onboarding.create_project.github.title')).toBeInTheDocument(); expect(screen.getByText('alm.configuration.selector.placeholder')).toBeInTheDocument(); expect(ui.instanceSelector.get()).toBeInTheDocument(); - await waitFor(() => selectEvent.select(ui.instanceSelector.get(), [/conf-github-3/])); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-github-3/ }).get()); expect(await ui.createErrorMessage.find()).toBeInTheDocument(); @@ -124,7 +127,8 @@ it('should show import project feature when the authentication is successfull', expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await waitFor(() => selectEvent.select(ui.organizationSelector.get(), [/org-1/])); + await user.click(ui.organizationSelector.get()); + await user.click(byRole('option', { name: /org-1/ }).get()); expect(await ui.project1.find()).toBeInTheDocument(); expect(ui.project2.get()).toBeInTheDocument(); @@ -176,7 +180,8 @@ it('should import several projects', async () => { expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await waitFor(() => selectEvent.select(ui.organizationSelector.get(), [/org-1/])); + await user.click(ui.organizationSelector.get()); + await user.click(byRole('option', { name: /org-1/ }).get()); expect(await ui.project1.find()).toBeInTheDocument(); expect(ui.project1Checkbox.get()).not.toBeChecked(); @@ -241,7 +246,8 @@ it('should show search filter when the authentication is successful', async () = expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await waitFor(() => selectEvent.select(ui.organizationSelector.get(), [/org-1/])); + await user.click(ui.organizationSelector.get()); + await user.click(byRole('option', { name: /org-1/ }).get()); const inputSearch = screen.getByRole('searchbox'); await user.click(inputSearch); @@ -266,7 +272,8 @@ it('should have load more', async () => { expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await waitFor(() => selectEvent.select(ui.organizationSelector.get(), [/org-1/])); + await user.click(ui.organizationSelector.get()); + await user.click(byRole('option', { name: /org-1/ }).get()); const loadMore = await screen.findByRole('button', { name: 'show_more' }); expect(loadMore).toBeInTheDocument(); @@ -288,13 +295,15 @@ it('should have load more', async () => { }); it('should show no result message when there are no projects', async () => { + const user = userEvent.setup(); almIntegrationHandler.setGithubRepositories([]); renderCreateProject('project/create?mode=github&dopSetting=conf-github-2&code=213321213'); expect(await ui.instanceSelector.find()).toBeInTheDocument(); - await waitFor(() => selectEvent.select(ui.organizationSelector.get(), [/org-1/])); + await user.click(ui.organizationSelector.get()); + await user.click(byRole('option', { name: /org-1/ }).get()); expect(screen.getByText('no_results')).toBeInTheDocument(); }); diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/GitLab-it.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/GitLab-it.tsx index b6d08bb85a1..04a2ead7fb7 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/GitLab-it.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/GitLab-it.tsx @@ -20,7 +20,6 @@ import { screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; -import selectEvent from 'react-select-event'; import { byLabelText, byRole, byText } from '~sonar-aligned/helpers/testSelector'; import { getGitlabProjects } from '../../../../api/alm-integrations'; import AlmIntegrationsServiceMock from '../../../../api/mocks/AlmIntegrationsServiceMock'; @@ -113,7 +112,8 @@ it('should ask for PAT when it is not set yet and show the import project featur expect(await ui.importProjectsTitle.find()).toBeInTheDocument(); expect(ui.instanceSelector.get()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-final-1/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-final-1/ }).get()); expect(await screen.findByText('onboarding.create_project.enter_pat')).toBeInTheDocument(); expect(ui.patHelpInstructions.get()).toBeInTheDocument(); @@ -127,10 +127,12 @@ it('should ask for PAT when it is not set yet and show the import project featur }); it('should show import project feature when PAT is already set', async () => { + const user = userEvent.setup(); renderCreateProject(); expect(await ui.importProjectsTitle.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-final-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-final-2/ }).get()); expect(await ui.project1.find()).toBeInTheDocument(); expect(ui.project1Link.get()).toHaveAttribute('href', '/dashboard?id=key'); @@ -146,7 +148,8 @@ it('should show search filter when PAT is already set', async () => { expect(await ui.importProjectsTitle.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-final-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-final-2/ }).get()); const inputSearch = await screen.findByRole('searchbox'); await user.click(inputSearch); @@ -173,7 +176,8 @@ it('should import several projects', async () => { renderCreateProject(); expect(await ui.importProjectsTitle.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-final-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-final-2/ }).get()); expect(await ui.project1.find()).toBeInTheDocument(); expect(ui.project1Checkbox.get()).not.toBeChecked(); @@ -237,7 +241,9 @@ it('should have load more', async () => { almIntegrationHandler.createRandomGitlabProjectsWithLoadMore(50, 75); renderCreateProject(); - await selectEvent.select(await ui.instanceSelector.find(), [/conf-final-2/]); + await user.click(await ui.instanceSelector.find()); + await user.click(byRole('option', { name: /conf-final-2/ }).get()); + const loadMore = await screen.findByRole('button', { name: 'show_more' }); expect(loadMore).toBeInTheDocument(); @@ -257,11 +263,13 @@ it('should have load more', async () => { }); it('should show no result message when there are no projects', async () => { + const user = userEvent.setup(); almIntegrationHandler.setGitlabProjects([]); renderCreateProject(); expect(await ui.importProjectsTitle.find()).toBeInTheDocument(); - await selectEvent.select(ui.instanceSelector.get(), [/conf-final-2/]); + await user.click(ui.instanceSelector.get()); + await user.click(byRole('option', { name: /conf-final-2/ }).get()); expect(await screen.findByText('no_results')).toBeInTheDocument(); }); diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/MonorepoProjectCreate-it.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/MonorepoProjectCreate-it.tsx index 2fdd09661d3..2d03e74765b 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/MonorepoProjectCreate-it.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/MonorepoProjectCreate-it.tsx @@ -20,7 +20,6 @@ import { waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; -import selectEvent from 'react-select-event'; import { byRole, byText } from '~sonar-aligned/helpers/testSelector'; import AlmIntegrationsServiceMock from '../../../../api/mocks/AlmIntegrationsServiceMock'; import AlmSettingsServiceMock from '../../../../api/mocks/AlmSettingsServiceMock'; @@ -124,6 +123,7 @@ describe('github monorepo project setup', () => { }); it('should display that selected repository is not bound to any existing project', async () => { + const user = userEvent.setup(); renderCreateProject({ code: '123', dopSetting: 'dop-setting-test-id', isMonorepo: true }); expect(await ui.monorepoTitle.find()).toBeInTheDocument(); @@ -131,17 +131,19 @@ describe('github monorepo project setup', () => { expect(await ui.dopSettingSelector.find()).toBeInTheDocument(); expect(ui.monorepoProjectTitle.query()).not.toBeInTheDocument(); - await waitFor(async () => { - await selectEvent.select(await ui.organizationSelector.find(), 'org-1'); - }); + await user.click(ui.organizationSelector.get()); + await user.click(byRole('option', { name: 'org-1' }).get()); + expect(ui.monorepoProjectTitle.query()).not.toBeInTheDocument(); - await selectEvent.select(await ui.repositorySelector.find(), 'Github repo 1'); + await user.click(ui.repositorySelector.get()); + await user.click(byRole('option', { name: 'Github repo 1' }).get()); expect(await ui.notBoundRepositoryMessage.find()).toBeInTheDocument(); }); it('should display that selected repository is already bound to an existing project', async () => { + const user = userEvent.setup(); projectManagementHandler.setProjects([ mockProject({ key: 'key123', @@ -155,12 +157,13 @@ describe('github monorepo project setup', () => { expect(await ui.dopSettingSelector.find()).toBeInTheDocument(); expect(ui.monorepoProjectTitle.query()).not.toBeInTheDocument(); - await waitFor(async () => { - await selectEvent.select(await ui.organizationSelector.find(), 'org-1'); - }); + await user.click(ui.organizationSelector.get()); + await user.click(byRole('option', { name: 'org-1' }).get()); + expect(ui.monorepoProjectTitle.query()).not.toBeInTheDocument(); - await selectEvent.select(await ui.repositorySelector.find(), 'Github repo 1'); + await user.click(ui.repositorySelector.get()); + await user.click(byRole('option', { name: 'Github repo 1' }).get()); expect(await ui.alreadyBoundRepositoryMessage.find()).toBeInTheDocument(); expect(byRole('link', { name: 'Project GitHub 1' }).get()).toBeInTheDocument(); @@ -175,12 +178,14 @@ describe('github monorepo project setup', () => { expect(await ui.dopSettingSelector.find()).toBeInTheDocument(); expect(ui.monorepoProjectTitle.query()).not.toBeInTheDocument(); - await waitFor(async () => { - await selectEvent.select(await ui.organizationSelector.find(), 'org-1'); - }); + await user.click(ui.organizationSelector.get()); + await user.click(byRole('option', { name: 'org-1' }).get()); + expect(ui.monorepoProjectTitle.query()).not.toBeInTheDocument(); - await selectEvent.select(await ui.repositorySelector.find(), 'Github repo 1'); + await user.click(ui.repositorySelector.get()); + await user.click(byRole('option', { name: 'Github repo 1' }).get()); + expect(await ui.monorepoProjectTitle.find()).toBeInTheDocument(); let projects = byRole('textbox', { name: /onboarding.create_project.project_key/, diff --git a/server/sonar-web/src/main/js/apps/create/project/components/DopSettingDropdown.tsx b/server/sonar-web/src/main/js/apps/create/project/components/DopSettingDropdown.tsx index 599318c0894..38a182477aa 100644 --- a/server/sonar-web/src/main/js/apps/create/project/components/DopSettingDropdown.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/components/DopSettingDropdown.tsx @@ -37,6 +37,10 @@ export interface DopSettingDropdownProps { const MIN_SIZE_INSTANCES = 2; function optionRenderer(props: OptionProps, false>) { + // For tests and a11y + props.innerProps.role = 'option'; + props.innerProps['aria-selected'] = props.isSelected; + return {customOptions(props.data.value)}; } -- cgit v1.2.3