Skip to content

Commit

Permalink
test: Fixes act errors in LastUpdated test (#21415)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Sep 12, 2022
1 parent 99628d3 commit c16a6dd
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import React from 'react';
import { ReactWrapper } from 'enzyme';
import { styledMount as mount } from 'spec/helpers/theming';
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
import LastUpdated from '.';

describe('LastUpdated', () => {
Expand All @@ -31,9 +32,10 @@ describe('LastUpdated', () => {
expect(/^Last Updated .+$/.test(wrapper.text())).toBe(true);
});

it('renders a refresh action', () => {
it('renders a refresh action', async () => {
const mockAction = jest.fn();
wrapper = mount(<LastUpdated updatedAt={updatedAt} update={mockAction} />);
await waitForComponentToPaint(wrapper);
const props = wrapper.find('[aria-label="refresh"]').first().props();
if (props.onClick) {
props.onClick({} as React.MouseEvent);
Expand Down

0 comments on commit c16a6dd

Please sign in to comment.