diff --git a/superset-frontend/src/components/PopoverSection/PopoverSection.test.tsx b/superset-frontend/src/components/PopoverSection/PopoverSection.test.tsx index 2135f6ba46..16952834c1 100644 --- a/superset-frontend/src/components/PopoverSection/PopoverSection.test.tsx +++ b/superset-frontend/src/components/PopoverSection/PopoverSection.test.tsx @@ -21,23 +21,23 @@ import { render, screen } from 'spec/helpers/testing-library'; import userEvent from '@testing-library/user-event'; import PopoverSection from 'src/components/PopoverSection'; -test('renders with default props', () => { +test('renders with default props', async () => { render(
, ); - expect(screen.getByRole('form')).toBeInTheDocument(); - expect(screen.getAllByRole('img').length).toBe(1); + expect(await screen.findByRole('form')).toBeInTheDocument(); + expect((await screen.findAllByRole('img')).length).toBe(1); }); -test('renders tooltip icon', () => { +test('renders tooltip icon', async () => { render(
, ); - expect(screen.getAllByRole('img').length).toBe(2); + expect((await screen.findAllByRole('img')).length).toBe(2); }); test('renders a tooltip when hovered', async () => { @@ -50,13 +50,13 @@ test('renders a tooltip when hovered', async () => { expect(await screen.findByRole('tooltip')).toBeInTheDocument(); }); -test('calls onSelect when clicked', () => { +test('calls onSelect when clicked', async () => { const onSelect = jest.fn(); render(
, ); - userEvent.click(screen.getByRole('img')); + userEvent.click(await screen.findByRole('img')); expect(onSelect).toHaveBeenCalled(); });