Wait for options to be shown before pressing Tab

This commit is contained in:
Koen Vlaswinkel
2024-01-31 12:36:09 +01:00
parent 841efbf826
commit 6bd8c8ee78

View File

@@ -200,6 +200,9 @@ describe("SuggestBox", () => {
});
await userEvent.click(screen.getByRole("combobox"));
expect(screen.getAllByRole("option")).not.toHaveLength(0);
await userEvent.keyboard("{Enter}");
expect(screen.queryByRole("option")).not.toBeInTheDocument();
@@ -211,6 +214,9 @@ describe("SuggestBox", () => {
});
await userEvent.click(screen.getByRole("combobox"));
expect(screen.getAllByRole("option")).not.toHaveLength(0);
await userEvent.keyboard("{Tab}");
expect(screen.queryByRole("option")).not.toBeInTheDocument();