Skip to content

Commit

Permalink
fix: bump @floating-ui/react to latest (#490)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated the `@floating-ui/react` library version to `0.26.12` in UI
components to enhance stability and performance.

- **Tests**
- Improved reliability of menu component tests by using `waitFor` to
check for element absence.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
aversini authored Apr 13, 2024
1 parent 399e6fe commit 67a84a5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"test": "vitest run"
},
"peerDependencies": {
"@floating-ui/react": "<=0.26.9",
"@floating-ui/react": "0.26.12",
"fast-equals": "5.0.1",
"micro-memoize": "4.1.2",
"react": "^18.2.0",
Expand All @@ -48,7 +48,7 @@
"@versini/ui-styles": "workspace:../ui-styles"
},
"dependencies": {
"@floating-ui/react": "<=0.26.9",
"@floating-ui/react": "0.26.12",
"@tailwindcss/typography": "0.5.12",
"@versini/ui-hooks": "workspace:../ui-hooks",
"@versini/ui-icons": "workspace:../ui-icons",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { render, screen } from "@testing-library/react";
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";

import { Menu, MenuItem, MenuSeparator } from "../..";
Expand Down Expand Up @@ -125,7 +125,9 @@ describe("Menu behaviors", () => {
expect(firstMenuItem).toHaveFocus();
expect(document.activeElement).toBe(firstMenuItem);
await user.click(firstMenuItem);
expect(trigger).toHaveFocus();
await waitFor(() => {
expect(screen.queryByText(FIRST_MENU_ITEM)).not.toBeInTheDocument();
});
});

it("should trigger the Menu onOpenChange callback when opened and closed", async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-private/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"react-dom": "18.2.0"
},
"dependencies": {
"@floating-ui/react": "<=0.26.9",
"@floating-ui/react": "0.26.12",
"@versini/ui-hooks": "workspace:../ui-hooks",
"clsx": "2.1.0"
},
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 67a84a5

Please sign in to comment.