test/ImagesTable: Remove should be wrapped into act() error
This wraps clicking on an error popover into `act()` and thus removes the `When testing, code that causes React state updates should be wrapped into act(...)` error.
This commit is contained in:
parent
c4f616763d
commit
3c85be25bb
1 changed files with 5 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
|
||||
import { screen, within } from '@testing-library/react';
|
||||
import { act, screen, within } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
|
||||
|
|
@ -222,7 +222,10 @@ describe('Images Table', () => {
|
|||
expect(
|
||||
screen.getAllByText(/c1cfa347-4c37-49b5-8e73-6aa1d1746cfa/i)[1]
|
||||
).not.toBeVisible();
|
||||
await user.click(errorPopover);
|
||||
|
||||
await act(async () => {
|
||||
await user.click(errorPopover);
|
||||
});
|
||||
|
||||
expect(screen.getAllByText(/Error in depsolve job/i)[0]).toBeVisible();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue