Skip to content

Commit

Permalink
test(select): fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fabien-ml committed Jan 19, 2023
1 parent 57c36be commit 06bae5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/multi-select/multi-select.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe("MultiSelect", () => {
expect(items[1]).toHaveTextContent("Two");
expect(items[2]).toHaveTextContent("Three");

expect(document.activeElement).toBe(items[0]);
expect(document.activeElement).toBe(listbox);

await triggerPress(items[0]);
await triggerPress(items[2]);
Expand Down
11 changes: 5 additions & 6 deletions packages/core/src/select/select.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe("Select", () => {
expect(items[1]).toHaveTextContent("Two");
expect(items[2]).toHaveTextContent("Three");

expect(document.activeElement).toBe(items[0]);
expect(document.activeElement).toBe(listbox);
});

it("can be opened on touch up", async () => {
Expand Down Expand Up @@ -162,7 +162,7 @@ describe("Select", () => {
expect(items[1]).toHaveTextContent("Two");
expect(items[2]).toHaveTextContent("Three");

expect(document.activeElement).toBe(items[0]);
expect(document.activeElement).toBe(listbox);
});

it("can be opened on Space key down", async () => {
Expand Down Expand Up @@ -991,7 +991,7 @@ describe("Select", () => {
expect(items[1]).toHaveTextContent("Two");
expect(items[2]).toHaveTextContent("Three");

expect(document.activeElement).toBe(items[0]);
expect(document.activeElement).toBe(listbox);

await triggerPress(items[2]);

Expand Down Expand Up @@ -1163,7 +1163,7 @@ describe("Select", () => {
expect(items[1]).toHaveTextContent("Two");
expect(items[2]).toHaveTextContent("Three");

expect(document.activeElement).toBe(items[0]);
expect(document.activeElement).toBe(listbox);

fireEvent.pointerEnter(items[1]);
await Promise.resolve();
Expand Down Expand Up @@ -1863,8 +1863,7 @@ describe("Select", () => {
expect(trigger).toHaveTextContent("France");
});

// TODO: failing, don't know why.
it.skip("should have a hidden input to marshall focus to the button", async () => {
it("should have a hidden input to marshall focus to the button", async () => {
render(() => (
<Select.Root onValueChange={onValueChange}>
<Select.Label>Label</Select.Label>
Expand Down

0 comments on commit 06bae5c

Please sign in to comment.