Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@
"@react-types/shared": "3.30.0",
"@storybook/react": "^8.4.5",
"@swc/core": "^1.3.35",
"@swc/jest": "^0.2.24",
"@swc/jest": "^0.2.39",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.2",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.14",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/jest": "^30.0.0",
"@types/node": "22.13.10",
"@types/react": "^18.0.1",
"@types/react-dom": "^18.0.0",
Expand All @@ -96,7 +96,7 @@
"eslint-import-resolver-typescript": "^4.3.4",
"eslint-loader": "^4.0.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.2.6",
Expand All @@ -113,9 +113,9 @@
"gray-matter": "^4.0.3",
"husky": "^8.0.1",
"intl-messageformat": "^10.1.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-watch-typeahead": "2.2.2",
"jest": "^30.0.4",
"jest-environment-jsdom": "^30.0.4",
"jest-watch-typeahead": "3.0.1",
"lint-staged": "^13.0.3",
"npm-check-updates": "^16.10.18",
"npm-run-all": "^4.1.5",
Expand Down
14 changes: 9 additions & 5 deletions packages/components/autocomplete/__tests__/autocomplete.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {UserEvent} from "@testing-library/user-event";
import type {AutocompleteProps} from "../src";

import * as React from "react";
import {within, render, renderHook, act} from "@testing-library/react";
import {within, render, renderHook, act, waitFor} from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import {spy, shouldIgnoreReactWarning} from "@heroui/test-utils";
import {useForm} from "react-hook-form";
Expand Down Expand Up @@ -79,11 +79,11 @@ const AutocompleteExample = (props: Partial<AutocompleteProps> = {}) => (
describe("Autocomplete", () => {
let user: UserEvent;

beforeAll(async () => {
beforeAll(() => {
jest.useFakeTimers({advanceTimers: true}).setSystemTime(new Date("2025-01-01"));
});

afterAll(async () => {
afterAll(() => {
jest.useRealTimers();
});

Expand Down Expand Up @@ -476,13 +476,17 @@ describe("Autocomplete", () => {
await user.click(autocomplete);

// assert that the autocomplete listbox is open
expect(autocomplete).toHaveAttribute("aria-expanded", "true");
await waitFor(() => {
expect(autocomplete).toHaveAttribute("aria-expanded", "true");
});

// click outside the autocomplete component
await user.click(document.body);

// assert that the autocomplete listbox is closed
expect(autocomplete).toHaveAttribute("aria-expanded", "false");
await waitFor(() => {
expect(autocomplete).toHaveAttribute("aria-expanded", "false");
});
});

it("should set the input after selection", async () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/components/popover/__tests__/popover.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ describe("Popover", () => {

const content = wrapper.getByTestId("content-test");

act(() => {
content.blur();
});
expect(content).toHaveFocus();

fireEvent.keyDown(content, {key: "Escape"});

expect(onClose).toHaveBeenCalledTimes(1);
});
Expand Down
Loading