diff --git a/superset-frontend/src/components/LastUpdated/LastUpdated.test.tsx b/superset-frontend/src/components/LastUpdated/LastUpdated.test.tsx index 8306959180571..1df3f60ee4766 100644 --- a/superset-frontend/src/components/LastUpdated/LastUpdated.test.tsx +++ b/superset-frontend/src/components/LastUpdated/LastUpdated.test.tsx @@ -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(); + await waitForComponentToPaint(wrapper); const props = wrapper.find('[aria-label="refresh"]').first().props(); if (props.onClick) { props.onClick({} as React.MouseEvent);