2022-05-02 19:54:19 +03:00
|
|
|
import { fireEvent, render, screen } from '@testing-library/react';
|
|
|
|
import { UseExistingIfFoundInfoIcon } from '../../src/short-urls/UseExistingIfFoundInfoIcon';
|
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 () => {
|
|
|
|
render(<UseExistingIfFoundInfoIcon />);
|
2019-03-17 20:14:36 +03:00
|
|
|
|
2022-05-02 19:54:19 +03:00
|
|
|
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
|
|
|
|
fireEvent.click(screen.getByTitle('What does this mean?').firstChild as Node);
|
|
|
|
expect(await screen.findByRole('dialog')).toBeInTheDocument();
|
2019-03-17 20:14:36 +03:00
|
|
|
});
|
|
|
|
});
|