Skip to content

Commit

Permalink
fix: test for safari
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabhdaware committed Feb 5, 2024
1 parent 7f6bc56 commit 66be949
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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' }));
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 66be949

Please sign in to comment.