Skip to content

Commit

Permalink
test: Fixes act errors in RefreshLabel test (#21390)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Sep 8, 2022
1 parent 700079f commit feb5810
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import { render, screen } from 'spec/helpers/testing-library';
import userEvent from '@testing-library/user-event';
import RefreshLabel from 'src/components/RefreshLabel';

test('renders with default props', () => {
test('renders with default props', async () => {
render(<RefreshLabel tooltipContent="Tooltip" onClick={jest.fn()} />);
const refresh = screen.getByRole('button');
const refresh = await screen.findByRole('button');
expect(refresh).toBeInTheDocument();
userEvent.hover(refresh);
});
Expand All @@ -38,10 +38,10 @@ test('renders tooltip on hover', async () => {
expect(tooltip).toHaveTextContent(tooltipText);
});

test('triggers on click event', () => {
test('triggers on click event', async () => {
const onClick = jest.fn();
render(<RefreshLabel tooltipContent="Tooltip" onClick={onClick} />);
const refresh = screen.getByRole('button');
const refresh = await screen.findByRole('button');
userEvent.click(refresh);
expect(onClick).toHaveBeenCalled();
});

0 comments on commit feb5810

Please sign in to comment.