Skip to content

Commit

Permalink
cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Jul 21, 2024
1 parent d08c45e commit 18ee1ad
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/bits-ui/src/tests/combobox/Combobox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,20 @@ describe("combobox - single", () => {
expectNotHighlighted(item1!);
});

it("starts keyboard navigation at the highlighted item even if hovered with mouse", async () => {
const { getByTestId, user, input } = await openSingle({}, kbd.ARROW_DOWN);
const [item1, item2, item3] = getItems(getByTestId);
await user.click(input);
await user.hover(item1!);
expectHighlighted(item1!);
await user.hover(item2!);
expectHighlighted(item2!);
expectNotHighlighted(item1!);
await user.keyboard(kbd.ARROW_DOWN);
expectHighlighted(item3!);
expectNotHighlighted(item2!);
});

it("selects a default item when provided", async () => {
const { getByTestId, queryByTestId, input, getHiddenInput } = await openSingle({
value: "2",
Expand Down

0 comments on commit 18ee1ad

Please sign in to comment.