mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-13 19:13:46 +00:00
Replaced firEvent with userEvent as much as possible
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { fireEvent, render, screen } from '@testing-library/react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { UseExistingIfFoundInfoIcon } from '../../src/short-urls/UseExistingIfFoundInfoIcon';
|
||||
|
||||
describe('<UseExistingIfFoundInfoIcon />', () => {
|
||||
it('shows modal when icon is clicked', async () => {
|
||||
const user = userEvent.setup();
|
||||
render(<UseExistingIfFoundInfoIcon />);
|
||||
|
||||
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
|
||||
fireEvent.click(screen.getByTitle('What does this mean?').firstChild as Node);
|
||||
await user.click(screen.getByTitle('What does this mean?').firstElementChild as Element);
|
||||
expect(await screen.findByRole('dialog')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user