Wait for option to not be present

This commit is contained in:
Koen Vlaswinkel
2024-01-31 13:29:28 +01:00
parent 6bd8c8ee78
commit 820989a8c5

View File

@@ -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 () => {