shlink-web-client/test/short-urls/UseExistingIfFoundInfoIcon.test.tsx
2023-08-03 09:13:10 +02:00

13 lines
637 B
TypeScript

import { screen } from '@testing-library/react';
import { UseExistingIfFoundInfoIcon } from '../../shlink-web-component/short-urls/UseExistingIfFoundInfoIcon';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<UseExistingIfFoundInfoIcon />', () => {
it('shows modal when icon is clicked', async () => {
const { user } = renderWithEvents(<UseExistingIfFoundInfoIcon />);
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
await user.click(screen.getByTitle('What does this mean?').firstElementChild as Element);
expect(await screen.findByRole('dialog')).toBeInTheDocument();
});
});