test/ShareImageModal: use act when accessing the UI
Errors were fired upon while testing the ShareImageModal because some clicks on the UI were not encapsulated in an act block. This is now patched up.
This commit is contained in:
parent
8144aaa76d
commit
2b051823bf
1 changed files with 2 additions and 2 deletions
|
|
@ -144,13 +144,13 @@ describe('Create Share To Regions Modal', () => {
|
|||
);
|
||||
|
||||
const selectToggle = screen.getByRole('button', { name: /options menu/i });
|
||||
await user.click(selectToggle);
|
||||
await act(async () => user.click(selectToggle));
|
||||
|
||||
const usEast2 = screen.getByRole('option', {
|
||||
name: /us-east-2 us east \(ohio\)/i,
|
||||
});
|
||||
expect(usEast2).not.toHaveClass('pf-m-disabled');
|
||||
await user.click(usEast2);
|
||||
await act(async () => user.click(usEast2));
|
||||
|
||||
const mockResponse = {
|
||||
id: '123e4567-e89b-12d3-a456-426655440000',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue