Skip to content

Commit

Permalink
fix(sqllab): added a test case for hideTooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
prosdev0107 committed Feb 17, 2022
1 parent 239135f commit 04c1c35
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ test('renders tooltip on hover', async () => {
expect(tooltip).toHaveTextContent(tooltipText);
});

test('not renders tooltip on hover with hideTooltip props', async () => {
const tooltipText = 'Tooltip';
render(<CopyToClipboard tooltipText={tooltipText} hideTooltip />, {
useRedux: true,
});
userEvent.hover(screen.getByText('Copy'));
const tooltip = screen.queryByRole('tooltip');
expect(tooltip).toBe(null);
});

test('triggers onCopyEnd', async () => {
const onCopyEnd = jest.fn();
render(<CopyToClipboard onCopyEnd={onCopyEnd} />, {
Expand Down

0 comments on commit 04c1c35

Please sign in to comment.