mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
test: Fixes act errors in LastUpdated test (#21415)
This commit is contained in:
committed by
GitHub
parent
99628d3e84
commit
c16a6dd2f4
@@ -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', () => {
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user