mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-15 20:13:48 +00:00
Moved common test set-up code to helper function
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { screen } from '@testing-library/react';
|
||||
import { UseExistingIfFoundInfoIcon } from '../../src/short-urls/UseExistingIfFoundInfoIcon';
|
||||
import { renderWithEvents } from '../__mocks__/setUpTest';
|
||||
|
||||
describe('<UseExistingIfFoundInfoIcon />', () => {
|
||||
it('shows modal when icon is clicked', async () => {
|
||||
const user = userEvent.setup();
|
||||
render(<UseExistingIfFoundInfoIcon />);
|
||||
const { user } = renderWithEvents(<UseExistingIfFoundInfoIcon />);
|
||||
|
||||
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
|
||||
await user.click(screen.getByTitle('What does this mean?').firstElementChild as Element);
|
||||
|
||||
Reference in New Issue
Block a user