From 66be949a353f9da1f6fd842416691bd7c513e6ef Mon Sep 17 00:00:00 2001 From: saurabhdaware Date: Mon, 5 Feb 2024 09:31:05 +0530 Subject: [PATCH] fix: test for safari --- .../Dropdown/__tests__/Dropdown.test.stories.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/blade/src/components/Dropdown/__tests__/Dropdown.test.stories.tsx b/packages/blade/src/components/Dropdown/__tests__/Dropdown.test.stories.tsx index 9aef15089bf..458d93f9938 100644 --- a/packages/blade/src/components/Dropdown/__tests__/Dropdown.test.stories.tsx +++ b/packages/blade/src/components/Dropdown/__tests__/Dropdown.test.stories.tsx @@ -236,16 +236,16 @@ ControlledDropdownSingleSelect.play = async ({ canvasElement }) => { // external button control selection test await expect(selectInput).toHaveTextContent('Select Option'); await userEvent.click(getByRole('button', { name: 'Select Bangalore' })); - await expect(selectInput).toHaveTextContent('Bangalore'); + await waitFor(() => expect(selectInput).toHaveTextContent('Bangalore')); // select input's control test await userEvent.click(selectInput); await userEvent.click(getByRole('option', { name: 'Pune' })); - await expect(selectInput).toHaveTextContent('Pune'); + await waitFor(() => expect(selectInput).toHaveTextContent('Pune')); // Clear button test await userEvent.click(getByRole('button', { name: 'Clear Selection' })); - await expect(selectInput).toHaveTextContent('Select Option'); + await waitFor(() => expect(selectInput).toHaveTextContent('Select Option')); // toggle dropdown test await userEvent.click(getByRole('button', { name: 'Open Dropdown' })); @@ -298,12 +298,12 @@ ControlledDropdownMultiSelect.play = async ({ canvasElement }) => { // Select 1 item programatically await expect(queryAllByLabelText('Close Bangalore tag')?.[0]).toBeFalsy(); await userEvent.click(getByRole('button', { name: 'Select Bangalore' })); - await expect(queryAllByLabelText('Close Bangalore tag')?.[0]).toBeInTheDocument(); + await waitFor(() => expect(queryAllByLabelText('Close Bangalore tag')?.[0]).toBeInTheDocument()); // select 2nd item from actionlist await userEvent.click(selectInput); await userEvent.click(getByRole('option', { name: 'Pune' })); - await expect(queryAllByLabelText('Close Pune tag')?.[0]).toBeInTheDocument(); + await waitFor(() => expect(queryAllByLabelText('Close Pune tag')?.[0]).toBeInTheDocument()); await expect(queryAllByLabelText('Close Bangalore tag')?.[0]).toBeInTheDocument(); // dropdown open test