From 211885bad75d3829d6946173b3456bb4bbb179dc Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sun, 17 Aug 2025 14:02:04 -0700 Subject: [PATCH] test(combo-box): add keyboard navigation menu test --- tests/ComboBox/ComboBox.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/ComboBox/ComboBox.test.ts b/tests/ComboBox/ComboBox.test.ts index b0cb62e6..7a0581c3 100644 --- a/tests/ComboBox/ComboBox.test.ts +++ b/tests/ComboBox/ComboBox.test.ts @@ -412,4 +412,14 @@ describe("ComboBox", () => { render(ComboBox, { props: { helperText: "Help", invalid: true } }); expect(screen.queryByText("Help")).not.toBeInTheDocument(); }); + + it("should not open menu when input is focused via keyboard", async () => { + render(ComboBox); + + await user.keyboard("{Tab}"); + expect(screen.getByRole("textbox")).toHaveFocus(); + + const dropdown = screen.queryAllByRole("listbox")[1]; + expect(dropdown).toBeUndefined(); + }); });