diff --git a/packages/components/src/List/ListComposition/ColumnChooser/ColumnChooser.component.test.js b/packages/components/src/List/ListComposition/ColumnChooser/ColumnChooser.component.test.js index 3d315e084e3..c5383be64f6 100644 --- a/packages/components/src/List/ListComposition/ColumnChooser/ColumnChooser.component.test.js +++ b/packages/components/src/List/ListComposition/ColumnChooser/ColumnChooser.component.test.js @@ -21,18 +21,19 @@ describe('ColumnChooser', () => { }; }); - it('should render column chooser component', () => { + it('should render column chooser component', async () => { // when render( - + , ); // then - expect(screen.getByRole('button')).toBeVisible(); - act(() => screen.getByRole('button').focus()); // trigger the tooltip - expect(screen.getByText('Open the column chooser')).toBeVisible(); + const btn = screen.getByLabelText('Open the column chooser'); + expect(btn).toBeVisible(); + await userEvent.hover(btn); + expect(screen.getByRole('tooltip')).toHaveTextContent('Open the column chooser'); }); it('should update columns', async () => { diff --git a/packages/components/src/List/ListComposition/DisplayMode/ListDisplayMode.component.test.js b/packages/components/src/List/ListComposition/DisplayMode/ListDisplayMode.component.test.js index 6941ad79ed0..ef2773f9f08 100644 --- a/packages/components/src/List/ListComposition/DisplayMode/ListDisplayMode.component.test.js +++ b/packages/components/src/List/ListComposition/DisplayMode/ListDisplayMode.component.test.js @@ -64,7 +64,7 @@ describe('List DisplayMode', () => { ); // then - act(() => screen.getAllByRole('button')[0].focus()); + await userEvent.hover(screen.getAllByRole('button')[0]); expect(screen.getByText('Set Table as current display mode.')).toBeVisible(); });