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