From d5097c875c3848e13464aa31abc08d73d637f0b1 Mon Sep 17 00:00:00 2001 From: Marin Atanasov <8436925+tyxla@users.noreply.github.com> Date: Mon, 20 May 2024 17:01:28 +0300 Subject: [PATCH] PaletteEdit: Fix flaky test (#61791) Co-authored-by: tyxla Co-authored-by: cbravobernal --- packages/components/src/palette-edit/test/index.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/components/src/palette-edit/test/index.tsx b/packages/components/src/palette-edit/test/index.tsx index 7ebdaa77ef0b8..9f6583275919f 100644 --- a/packages/components/src/palette-edit/test/index.tsx +++ b/packages/components/src/palette-edit/test/index.tsx @@ -170,11 +170,13 @@ describe( 'PaletteEdit', () => { } ) ); - expect( - screen.getByRole( 'button', { - name: 'Remove all colors', - } ) - ).toBeVisible(); + await waitFor( () => { + expect( + screen.getByRole( 'button', { + name: 'Remove all colors', + } ) + ).toBeVisible(); + } ); } ); it( 'shows a reset option when the `canReset` prop is enabled', async () => {