Skip to content

Commit

Permalink
fix accordion test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoskolodny committed Oct 9, 2023
1 parent 169667a commit d82cfbc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/__tests__/accordion-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ test('Accordion with index', async () => {
await userEvent.click(screen.getByText('Title 3'));

/** We need to wait for CSS transition to finish in order for panel to be removed */
await waitForElementToBeRemoved(() => screen.queryByText('Content 1'));
await waitForElementToBeRemoved(screen.queryByText('Content 1'));
expect(screen.getByText('Content 2')).toBeInTheDocument();
await waitForElementToBeRemoved(() => screen.queryByText('Content 3'));
await waitForElementToBeRemoved(screen.queryByText('Content 3'));
});

test('Accordion with default index', async () => {
Expand All @@ -104,7 +104,7 @@ test('Accordion with default index', async () => {
await userEvent.click(screen.getByText('Title 2'));

/** We need to wait for CSS transition to finish in order for panel to be removed */
await waitForElementToBeRemoved(() => screen.queryByText('Content 1'));
await waitForElementToBeRemoved(screen.queryByText('Content 1'));
expect(screen.getByText('Content 2')).toBeInTheDocument();
expect(screen.getByText('Content 3')).toBeInTheDocument();
});
Expand All @@ -129,7 +129,7 @@ test('Accordion with singleOpen', async () => {
await userEvent.click(screen.getByText('Title 3'));

/** We need to wait for CSS transition to finish in order for panel to be removed */
await waitForElementToBeRemoved(() => screen.queryByText('Content 1'));
await waitForElementToBeRemoved(() => screen.queryByText('Content 2'));
await waitForElementToBeRemoved(screen.queryByText('Content 1'));
await waitForElementToBeRemoved(screen.queryByText('Content 2'));
expect(screen.getByText('Content 3')).toBeInTheDocument();
});

0 comments on commit d82cfbc

Please sign in to comment.