2022-07-09 23:03:21 +02:00
|
|
|
import { screen } from '@testing-library/react';
|
2022-05-02 18:54:19 +02:00
|
|
|
import { UseExistingIfFoundInfoIcon } from '../../src/short-urls/UseExistingIfFoundInfoIcon';
|
2022-07-10 19:44:49 +02:00
|
|
|
import { renderWithEvents } from '../__helpers__/setUpTest';
|
2019-03-17 18:14:36 +01:00
|
|
|
|
|
|
|
describe('<UseExistingIfFoundInfoIcon />', () => {
|
2022-05-02 18:54:19 +02:00
|
|
|
it('shows modal when icon is clicked', async () => {
|
2022-07-09 23:03:21 +02:00
|
|
|
const { user } = renderWithEvents(<UseExistingIfFoundInfoIcon />);
|
2019-03-17 18:14:36 +01:00
|
|
|
|
2022-05-02 18:54:19 +02:00
|
|
|
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
|
2022-05-11 19:18:43 +02:00
|
|
|
await user.click(screen.getByTitle('What does this mean?').firstElementChild as Element);
|
2022-05-02 18:54:19 +02:00
|
|
|
expect(await screen.findByRole('dialog')).toBeInTheDocument();
|
2019-03-17 18:14:36 +01:00
|
|
|
});
|
|
|
|
});
|