test: Fix await-async-events error

After cleaning up the ESLint plugins a new error for eslint-plugin-testing-library popped up. This PR solves all of the occurences of `Promise returned from async event method `user` must be handled` and removes the `"testing-library/await-async-events": "off"` switch which was temporary put in place.
This commit is contained in:
regexowl 2023-10-20 10:24:22 +02:00 committed by Klara Simickova
parent 2687312f16
commit 7b0b9a8ddc
5 changed files with 108 additions and 106 deletions

View file

@ -9,8 +9,7 @@
],
"rules": {
"react/display-name": "off",
"react/prop-types": "off",
"testing-library/await-async-events": "off"
"react/prop-types": "off"
},
"extends": [
"plugin:testing-library/react",

View file

@ -159,7 +159,7 @@ describe('Step Upload to Azure', () => {
expect(nextButton).not.toHaveClass('pf-m-disabled');
user.click(screen.getByTestId('azure-radio-source'));
await user.click(screen.getByTestId('azure-radio-source'));
await waitFor(() => expect(nextButton).toHaveClass('pf-m-disabled'));
@ -169,9 +169,9 @@ describe('Step Upload to Azure', () => {
expect(screen.getByTestId('azure-tenant-id-source')).toHaveValue('');
expect(screen.getByTestId('azure-subscription-id-source')).toHaveValue('');
user.click(sourceDropdown);
await user.click(sourceDropdown);
user.click(
await user.click(
await screen.findByRole('option', {
name: /azureSource1/i,
})
@ -198,8 +198,8 @@ describe('Step Upload to Azure', () => {
const sourceDropdown = await getSourceDropdown();
user.click(sourceDropdown);
user.click(
await user.click(sourceDropdown);
await user.click(
await screen.findByRole('option', {
name: /azureSource1/i,
})
@ -208,8 +208,8 @@ describe('Step Upload to Azure', () => {
expect(screen.getByTestId('azure-tenant-id-source')).not.toHaveValue('')
);
user.click(sourceDropdown);
user.click(
await user.click(sourceDropdown);
await user.click(
await screen.findByRole('option', {
name: /azureSource2/i,
})

View file

@ -61,7 +61,7 @@ jest.mock('@redhat-cloud-services/frontend-components/useChrome', () => ({
const searchForAvailablePackages = async (searchbox, searchTerm) => {
const user = userEvent.setup();
await user.type(searchbox, searchTerm);
user.click(
await user.click(
await screen.findByRole('button', {
name: /search button for available packages/i,
})
@ -115,7 +115,7 @@ describe('Step Packages', () => {
await clickNext();
// aws step
user.click(
await user.click(
screen.getByRole('radio', {
name: /manually enter an account id\./i,
})
@ -130,7 +130,7 @@ describe('Step Packages', () => {
name: 'Select activation key',
});
user.click(await screen.findByTestId('registration-radio-later'));
await user.click(await screen.findByTestId('registration-radio-later'));
await clickNext();
// skip fsc
await clickNext();
@ -207,15 +207,15 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
await searchForAvailablePackages(searchbox, 'test');
await user.click(await screen.findByTestId('available-pkgs-testPkg'));
await user.click(screen.getByRole('button', { name: /Add selected/ }));
user.click(screen.getByTestId('selected-pkgs-testPkg'));
user.click(screen.getByRole('button', { name: /Remove selected/ }));
await user.click(screen.getByTestId('selected-pkgs-testPkg'));
await user.click(screen.getByRole('button', { name: /Remove selected/ }));
const availablePackagesList = screen.getByTestId('available-pkgs-list');
const availablePackagesItems = within(availablePackagesList).getAllByRole(
@ -234,11 +234,11 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
await searchForAvailablePackages(searchbox, 'test');
user.click(screen.getByRole('button', { name: /Add all/ }));
await user.click(screen.getByRole('button', { name: /Add all/ }));
await user.click(screen.getByRole('button', { name: /Remove all/ }));
const availablePackagesList = screen.getByTestId('available-pkgs-list');
@ -258,14 +258,14 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
await searchForAvailablePackages(searchbox, 'test');
user.click(screen.getByRole('button', { name: /Add all/ }));
await user.click(screen.getByRole('button', { name: /Add all/ }));
// remove a single package
await user.click(await screen.findByTestId('selected-pkgs-lib-test'));
user.click(screen.getByRole('button', { name: /Remove selected/ }));
await user.click(screen.getByRole('button', { name: /Remove selected/ }));
// skip name page
clickNext();
@ -281,12 +281,12 @@ describe('Step Packages', () => {
clickBack();
clickBack();
await screen.findByTestId('search-available-pkgs-input');
user.click(
await user.click(
screen.getByRole('option', {
name: /summary for test package/,
})
);
user.click(screen.getByRole('button', { name: /Remove selected/ }));
await user.click(screen.getByRole('button', { name: /Remove selected/ }));
// review page
clickNext();
@ -303,7 +303,7 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
await searchForAvailablePackages(searchbox, 'asdf');
await screen.findByText('No results found');
@ -315,11 +315,11 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
await searchForAvailablePackages(searchbox, 'test');
user.click(
await user.click(
await screen.findByRole('button', {
name: /clear available packages search/i,
})
@ -337,12 +337,12 @@ describe('Step Packages', () => {
const searchboxChosen = screen.getAllByRole('textbox')[1];
await waitFor(() => expect(searchboxAvailable).toBeEnabled());
user.click(searchboxAvailable);
await user.click(searchboxAvailable);
await searchForAvailablePackages(searchboxAvailable, 'test');
user.click(await screen.findByRole('button', { name: /Add all/ }));
await user.click(await screen.findByRole('button', { name: /Add all/ }));
user.click(searchboxChosen);
await user.click(searchboxChosen);
await user.type(searchboxChosen, 'asdf');
expect(screen.getByText('No packages found')).toBeInTheDocument();
@ -356,7 +356,7 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
const getPackages = jest
.spyOn(api, 'getPackages')
@ -379,7 +379,7 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
const getPackages = jest
.spyOn(api, 'getPackages')
@ -408,7 +408,7 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
const getPackages = jest
.spyOn(api, 'getPackages')
@ -435,7 +435,7 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0];
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
await searchForAvailablePackages(searchbox, 'test');
@ -445,7 +445,7 @@ describe('Step Packages', () => {
).findAllByRole('option');
expect(availablePackagesItems).toHaveLength(3);
user.click(
await user.click(
await screen.findByRole('button', {
name: /clear available packages search/i,
})
@ -462,7 +462,7 @@ describe('Step Packages', () => {
const availableSearchbox = screen.getAllByRole('textbox')[0];
await waitFor(() => expect(availableSearchbox).toBeEnabled());
user.click(availableSearchbox);
await user.click(availableSearchbox);
await searchForAvailablePackages(availableSearchbox, 'test');
@ -472,7 +472,7 @@ describe('Step Packages', () => {
).findAllByRole('option');
await waitFor(() => expect(availablePackagesItems).toHaveLength(3));
user.click(await screen.findByRole('button', { name: /Add all/ }));
await user.click(await screen.findByRole('button', { name: /Add all/ }));
const chosenPackagesList = screen.getByTestId('chosen-pkgs-list');
let chosenPackagesItems = await within(chosenPackagesList).findAllByRole(
@ -546,7 +546,7 @@ describe('Step Packages', () => {
//const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
await searchForAvailablePackages(searchbox, 'test');
@ -569,15 +569,15 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
await searchForAvailablePackages(searchbox, 'test');
user.click(await screen.findByTestId('available-pkgs-testPkg'));
user.click(screen.getByRole('button', { name: /Add selected/ }));
await user.click(await screen.findByTestId('available-pkgs-testPkg'));
await user.click(screen.getByRole('button', { name: /Add selected/ }));
user.click(await screen.findByTestId('selected-pkgs-testPkg'));
user.click(screen.getByRole('button', { name: /Remove selected/ }));
await user.click(await screen.findByTestId('selected-pkgs-testPkg'));
await user.click(screen.getByRole('button', { name: /Remove selected/ }));
const availablePackagesList = screen.getByTestId('available-pkgs-list');
const availablePackagesItems = within(availablePackagesList).getAllByRole(
@ -596,12 +596,12 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
await searchForAvailablePackages(searchbox, 'test');
user.click(screen.getByRole('button', { name: /Add all/ }));
user.click(screen.getByRole('button', { name: /Remove all/ }));
await user.click(screen.getByRole('button', { name: /Add all/ }));
await user.click(screen.getByRole('button', { name: /Remove all/ }));
const availablePackagesList = screen.getByTestId('available-pkgs-list');
const availablePackagesItems = await within(
@ -620,14 +620,14 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
await searchForAvailablePackages(searchbox, 'test');
user.click(screen.getByRole('button', { name: /Add all/ }));
await user.click(screen.getByRole('button', { name: /Add all/ }));
// remove a single package
user.click(await screen.findByTestId('selected-pkgs-lib-test'));
user.click(screen.getByRole('button', { name: /Remove selected/ }));
await user.click(await screen.findByTestId('selected-pkgs-lib-test'));
await user.click(screen.getByRole('button', { name: /Remove selected/ }));
// skip Custom repositories page
clickNext();
@ -648,7 +648,7 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
await searchForAvailablePackages(searchbox, 'asdf');
@ -662,12 +662,12 @@ describe('Step Packages', () => {
const searchboxChosen = screen.getAllByRole('textbox')[1];
await waitFor(() => expect(searchboxAvailable).toBeEnabled());
user.click(searchboxAvailable);
await user.click(searchboxAvailable);
await searchForAvailablePackages(searchboxAvailable, 'test');
user.click(screen.getByRole('button', { name: /Add all/ }));
await user.click(screen.getByRole('button', { name: /Add all/ }));
user.click(searchboxChosen);
await user.click(searchboxChosen);
await user.type(searchboxChosen, 'asdf');
expect(screen.getByText('No packages found')).toBeInTheDocument();
@ -681,7 +681,7 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
const getPackages = jest
.spyOn(api, 'getPackagesContentSources')
@ -710,7 +710,7 @@ describe('Step Packages', () => {
const searchbox = screen.getAllByRole('textbox')[0];
await waitFor(() => expect(searchbox).toBeEnabled());
user.click(searchbox);
await user.click(searchbox);
await searchForAvailablePackages(searchbox, 'test');
@ -720,7 +720,7 @@ describe('Step Packages', () => {
).findAllByRole('option');
expect(availablePackagesItems).toHaveLength(3);
user.click(
await user.click(
screen.getByRole('button', { name: /clear available packages search/i })
);
@ -735,7 +735,7 @@ describe('Step Packages', () => {
const availableSearchbox = screen.getAllByRole('textbox')[0];
await waitFor(() => expect(availableSearchbox).toBeEnabled());
user.click(availableSearchbox);
await user.click(availableSearchbox);
await searchForAvailablePackages(availableSearchbox, 'test');
@ -745,7 +745,7 @@ describe('Step Packages', () => {
).findAllByRole('option');
expect(availablePackagesItems).toHaveLength(3);
user.click(screen.getByRole('button', { name: /Add all/ }));
await user.click(screen.getByRole('button', { name: /Add all/ }));
const chosenPackagesList = screen.getByTestId('chosen-pkgs-list');
let chosenPackagesItems = await within(chosenPackagesList).findAllByRole(
@ -754,7 +754,7 @@ describe('Step Packages', () => {
expect(chosenPackagesItems).toHaveLength(3);
const chosenSearchbox = screen.getAllByRole('textbox')[1];
user.click(chosenSearchbox);
await user.click(chosenSearchbox);
await searchForChosenPackages(chosenSearchbox, 'lib');
chosenPackagesItems = within(chosenPackagesList).getAllByRole('option');
// eslint-disable-next-line jest-dom/prefer-in-document
@ -779,7 +779,7 @@ describe('Step Custom repositories', () => {
({ router } = renderCustomRoutesWithReduxRouter('imagewizard', {}, routes));
// select aws as upload destination
user.click(await screen.findByTestId('upload-aws'));
await user.click(await screen.findByTestId('upload-aws'));
await clickNext();
// aws step
@ -794,7 +794,7 @@ describe('Step Custom repositories', () => {
name: 'Select activation key',
});
user.click(screen.getByLabelText('Register later'));
await user.click(screen.getByLabelText('Register later'));
await clickNext();
// skip fsc
await clickNext();

View file

@ -78,7 +78,7 @@ jest.mock('@unleash/proxy-client-react', () => ({
const searchForAvailablePackages = async (searchbox, searchTerm) => {
const user = userEvent.setup();
await user.type(searchbox, searchTerm);
user.click(
await user.click(
await screen.findByRole('button', {
name: /search button for available packages/i,
})
@ -177,15 +177,15 @@ describe('Step Image output', () => {
const awsTile = screen.getByTestId('upload-aws');
// this has already been clicked once in the setup function
user.click(awsTile); // deselect
await user.click(awsTile); // deselect
const googleTile = screen.getByTestId('upload-google');
user.click(googleTile); // select
user.click(googleTile); // deselect
await user.click(googleTile); // select
await user.click(googleTile); // deselect
const azureTile = screen.getByTestId('upload-azure');
user.click(azureTile); // select
user.click(azureTile); // deselect
await user.click(azureTile); // select
await user.click(azureTile); // deselect
await waitFor(() => expect(nextButton).toBeDisabled());
});
@ -353,7 +353,7 @@ describe('Step Upload to AWS', () => {
expect(nextButton).not.toHaveClass('pf-m-disabled');
user.click(
await user.click(
screen.getByRole('radio', {
name: /use an account configured from sources\./i,
})
@ -362,12 +362,12 @@ describe('Step Upload to AWS', () => {
await waitFor(() => expect(nextButton).toHaveClass('pf-m-disabled'));
const sourceDropdown = await getSourceDropdown();
user.click(sourceDropdown);
await user.click(sourceDropdown);
const source = await screen.findByRole('option', {
name: /my_source/i,
});
user.click(source);
await user.click(source);
await waitFor(() => expect(nextButton).not.toHaveClass('pf-m-disabled'));
});
@ -376,12 +376,12 @@ describe('Step Upload to AWS', () => {
await setUp();
const sourceDropdown = await getSourceDropdown();
user.click(sourceDropdown);
await user.click(sourceDropdown);
const source = await screen.findByRole('option', {
name: /my_source/i,
});
user.click(source);
await user.click(source);
await clickNext();
@ -426,7 +426,7 @@ describe('Step Upload to AWS', () => {
// return Promise.resolve({ id });
// });
user.click(screen.getByRole('button', { name: /Create/ }));
await user.click(screen.getByRole('button', { name: /Create/ }));
// returns back to the landing page
await waitFor(() =>
@ -498,7 +498,7 @@ describe('Step Upload to Google', () => {
screen.getByTestId('account-sharing');
});
user.click(screen.getByTestId('account-sharing'));
await user.click(screen.getByTestId('account-sharing'));
const accessKeyId = await screen.findByTestId('input-google-email');
expect(accessKeyId).toHaveValue('');
expect(accessKeyId).toBeEnabled();
@ -689,7 +689,7 @@ describe('Step Registration', () => {
]);
// click the later radio button which should remove any input fields
user.click(screen.getByTestId('registration-radio-later'));
await user.click(screen.getByTestId('registration-radio-later'));
await removeKeyInformation;
@ -751,13 +751,13 @@ describe('Step File system configuration', () => {
const manuallyConfigurePartitions = screen.getByText(
/manually configure partitions/i
);
user.click(manuallyConfigurePartitions);
await user.click(manuallyConfigurePartitions);
const addPartition = await screen.findByTestId('file-system-add-partition');
// Create duplicate partitions
user.click(addPartition);
user.click(addPartition);
await user.click(addPartition);
await user.click(addPartition);
expect(await getNextButton()).toBeEnabled();
@ -781,11 +781,11 @@ describe('Step File system configuration', () => {
const mountPointOptions = within(rows[2]).getAllByRole('button', {
name: 'Options menu',
})[0];
user.click(mountPointOptions);
await user.click(mountPointOptions);
const varButton = await within(rows[2]).findByRole('option', {
name: '/var',
});
user.click(varButton);
await user.click(varButton);
await waitFor(() => expect(mountPointWarning).not.toBeInTheDocument());
await waitFor(() => expect(mountPointAlerts[0]).not.toBeInTheDocument());
@ -1118,17 +1118,17 @@ describe('Click through all steps', () => {
const mountPointMenu = within(rows[2]).getAllByRole('button', {
name: 'Options menu',
})[0];
user.click(mountPointMenu);
await user.click(mountPointMenu);
const varButton = await within(rows[2]).findByRole('option', {
name: '/var',
});
user.click(varButton);
await waitForElementToBeRemoved(() =>
screen.queryAllByRole('heading', {
await user.click(varButton);
expect(
screen.queryByRole('heading', {
name: 'Danger alert: Duplicate mount point.',
})
);
).not.toBeInTheDocument();
await user.type(
within(rows[2]).getByRole('textbox', {
name: 'Mount point suffix text input',
@ -1144,12 +1144,12 @@ describe('Click through all steps', () => {
const unitMenu = within(rows[2]).getAllByRole('button', {
name: 'Options menu',
})[1];
user.click(unitMenu);
await user.click(unitMenu);
const mibButton = await within(rows[2]).findByRole('option', {
name: 'MiB',
});
user.click(mibButton);
await user.click(mibButton);
await clickNext();
screen.getByText(
@ -1161,12 +1161,12 @@ describe('Click through all steps', () => {
await waitFor(() => expect(searchbox).toBeEnabled());
await searchForAvailablePackages(searchbox, 'test');
user.click(
await user.click(
await screen.findByRole('option', {
name: /test summary for test package/,
})
);
user.click(screen.getByRole('button', { name: /Add selected/ }));
await user.click(screen.getByRole('button', { name: /Add selected/ }));
await clickNext();
// Custom repositories
@ -1202,7 +1202,7 @@ describe('Click through all steps', () => {
const targetEnvironmentsExpandable = await screen.findByTestId(
'target-environments-expandable'
);
user.click(targetEnvironmentsExpandable);
await user.click(targetEnvironmentsExpandable);
await screen.findAllByText('AWS');
await screen.findAllByText('GCP');
await screen.findByText('VMWare vSphere (.ova)');
@ -1212,7 +1212,7 @@ describe('Click through all steps', () => {
const registrationExpandable = await screen.findByTestId(
'registration-expandable'
);
user.click(registrationExpandable);
await user.click(registrationExpandable);
const review = screen.getByTestId('review-registration');
expect(review).toHaveTextContent(
'Use remote host configuration (rhc) utility'
@ -1221,7 +1221,7 @@ describe('Click through all steps', () => {
const imageDetailsExpandable = await screen.findByTestId(
'image-details-expandable'
);
user.click(imageDetailsExpandable);
await user.click(imageDetailsExpandable);
await screen.findByText('my-image-name');
await screen.findByText('this is a perfect description for image');
@ -1229,13 +1229,13 @@ describe('Click through all steps', () => {
await screen.findByText('Self-Support');
await screen.findByText('Production');
user.click(screen.getByTestId('repositories-popover-button'));
await user.click(screen.getByTestId('repositories-popover-button'));
const repotbody = await screen.findByTestId(
'additional-repositories-table'
);
expect(within(repotbody).getAllByRole('row')).toHaveLength(3);
user.click(screen.getByTestId('file-system-configuration-popover'));
await user.click(screen.getByTestId('file-system-configuration-popover'));
const revtbody = await screen.findByTestId(
'file-system-configuration-tbody-review'
);
@ -1419,28 +1419,31 @@ describe('Keyboard accessibility', () => {
// Target environment aws
expect(screen.getByTestId('aws-radio-source')).toHaveFocus();
const awsSourceDropdown = await getSourceDropdown();
user.click(awsSourceDropdown);
await user.click(awsSourceDropdown);
const awsSource = await screen.findByRole('option', {
name: /my_source/i,
});
user.click(awsSource);
await user.click(awsSource);
await clickNext();
// Target environment google
await user.click(screen.getByTestId('account-sharing'));
expect(screen.getByTestId('account-sharing')).toHaveFocus();
await user.type(screen.getByTestId('input-google-email'), 'test@test.com');
await user.click(await screen.findByTestId('account-sharing'));
expect(await screen.findByTestId('account-sharing')).toHaveFocus();
await user.type(
await screen.findByTestId('input-google-email'),
'test@test.com'
);
await clickNext();
// Target environment azure
expect(screen.getByTestId('azure-radio-source')).toHaveFocus();
const azureSourceDropdown = await getSourceDropdown();
user.click(azureSourceDropdown);
await user.click(azureSourceDropdown);
const azureSource = await screen.findByRole('option', {
name: /azureSource1/i,
});
user.click(azureSource);
await user.click(azureSource);
const resourceGroupDropdown = await screen.findByRole('textbox', {
name: /select resource group/i,

View file

@ -42,19 +42,19 @@ describe('Create Share To Regions Modal', () => {
const selectToggle = screen.getByRole('button', { name: /menu toggle/i });
// eslint-disable-next-line testing-library/no-unnecessary-act
user.click(selectToggle);
await user.click(selectToggle);
const usEast2 = await screen.findByRole('option', {
name: /us east \(ohio\) us\-east\-2/i,
});
expect(usEast2).not.toHaveClass('pf-m-disabled');
user.click(usEast2);
await user.click(usEast2);
await waitFor(() => expect(shareButton).toBeEnabled());
const clearAllButton = screen.getByRole('button', {
name: /clear input value/i,
});
user.click(clearAllButton);
await user.click(clearAllButton);
await waitFor(() => expect(shareButton).toBeDisabled());
const invalidAlert = screen.getByText(
@ -71,7 +71,7 @@ describe('Create Share To Regions Modal', () => {
);
const cancelButton = await screen.findByRole('button', { name: /cancel/i });
user.click(cancelButton);
await user.click(cancelButton);
// returns back to the landing page
await waitFor(() =>
@ -87,7 +87,7 @@ describe('Create Share To Regions Modal', () => {
);
const closeButton = await screen.findByRole('button', { name: /close/i });
user.click(closeButton);
await user.click(closeButton);
// returns back to the landing page
await waitFor(() =>
@ -102,7 +102,7 @@ describe('Create Share To Regions Modal', () => {
name: /menu toggle/i,
});
// eslint-disable-next-line testing-library/no-unnecessary-act
user.click(selectToggle);
await user.click(selectToggle);
// parent region disabled
const usEast1 = await screen.findByRole('option', {