From db5e25452143248f8ebe22b8e72b8b51874f64d3 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Fri, 12 Jan 2024 16:46:26 +0100 Subject: [PATCH] Wait for focus to move --- packages/components/src/tabs/test/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/components/src/tabs/test/index.tsx b/packages/components/src/tabs/test/index.tsx index 24b7e75b6e72b..8c2c2d0fd2fa2 100644 --- a/packages/components/src/tabs/test/index.tsx +++ b/packages/components/src/tabs/test/index.tsx @@ -1260,7 +1260,9 @@ describe( 'Tabs', () => { // Tab key should focus the currently selected tab, which is Beta. await press.Tab(); - expect( await getSelectedTab() ).toHaveFocus(); + await waitFor( async () => + expect( await getSelectedTab() ).toHaveFocus() + ); rerender(