Wait for option to not be present
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { render as reactRender, screen } from "@testing-library/react";
|
||||
import { render as reactRender, screen, waitFor } from "@testing-library/react";
|
||||
import type { SuggestBoxProps } from "../SuggestBox";
|
||||
import { SuggestBox } from "../SuggestBox";
|
||||
import { userEvent } from "@testing-library/user-event";
|
||||
@@ -219,7 +219,9 @@ describe("SuggestBox", () => {
|
||||
|
||||
await userEvent.keyboard("{Tab}");
|
||||
|
||||
expect(screen.queryByRole("option")).not.toBeInTheDocument();
|
||||
await waitFor(() => {
|
||||
expect(screen.queryByRole("option")).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it("shows no suggestions with no matching followup options", async () => {
|
||||
|
||||
Reference in New Issue
Block a user