Wizard: Replace deprecated select in AwsSourcesSelect

This replaces a deprecated select in `AwsSourcesSelect` for a non-deprecated one.
This commit is contained in:
regexowl 2025-03-10 10:07:13 +01:00 committed by Klara Simickova
parent 0f230c18d9
commit b767c3bfde
4 changed files with 136 additions and 47 deletions

View file

@ -3,16 +3,7 @@ import userEvent from '@testing-library/user-event';
import { clickNext, renderCreateMode } from './wizardTestUtils';
const getAwsSourceDropdown = async () => {
const sourceDropdown = await screen.findByRole('textbox', {
name: /select source/i,
});
await waitFor(() => expect(sourceDropdown).toBeEnabled());
return sourceDropdown;
};
const getAzureSourceDropdown = async () => {
const getSourceDropdown = async () => {
const sourceDropdown = await screen.findByPlaceholderText(/select source/i);
await waitFor(() => expect(sourceDropdown).toBeEnabled());
@ -26,7 +17,7 @@ export const addTargetEnvAzure = async () => {
name: /use an account configured from sources\./i,
})
).toHaveFocus();
const azureSourceDropdown = await getAzureSourceDropdown();
const azureSourceDropdown = await getSourceDropdown();
await waitFor(() => user.click(azureSourceDropdown));
const azureSource = await screen.findByRole('option', {
name: /azureSource1/i,
@ -119,7 +110,7 @@ describe('Keyboard accessibility', () => {
name: /use an account configured from sources\./i,
})
).toHaveFocus();
const awsSourceDropdown = await getAwsSourceDropdown();
const awsSourceDropdown = await getSourceDropdown();
await waitFor(() => user.click(awsSourceDropdown));
const awsSource = await screen.findByRole('option', {
name: /my_source/i,

View file

@ -110,9 +110,7 @@ const chooseSourcesOption = async () => {
};
const getSourceDropdown = async () => {
const sourceDropdown = await screen.findByRole('textbox', {
name: /select source/i,
});
const sourceDropdown = await screen.findByPlaceholderText(/select source/i);
await waitFor(() => expect(sourceDropdown).toBeEnabled());
return sourceDropdown;
@ -120,9 +118,7 @@ const getSourceDropdown = async () => {
const selectSource = async () => {
const user = userEvent.setup();
const sourceTexbox = await screen.findByRole('textbox', {
name: /select source/i,
});
const sourceTexbox = await screen.findByPlaceholderText(/select source/i);
await waitFor(async () => user.click(sourceTexbox));
const sourceOption = await screen.findByRole('option', {