Skip to content

Commit

Permalink
Merge branch 'master' into fix/menu-hover-enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks authored Feb 20, 2025
2 parents 3871970 + be07bd6 commit fc0cf54
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 443 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/browser": "^2.1.8",
"@vitest/coverage-istanbul": "2.1.8",
"@vitest/ui": "2.1.8",
"@vitest/browser": "^3.0.5",
"@vitest/coverage-istanbul": "3.0.5",
"@vitest/ui": "3.0.5",
"babel-loader": "^9.2.1",
"babel-plugin-add-import-extension": "1.6.0",
"babel-plugin-macros": "^3.1.0",
Expand Down Expand Up @@ -149,8 +149,8 @@
"typescript": "^5.7.3",
"unist-util-visit": "^5.0.0",
"url-join": "4.0.1",
"vite": "^6.0.11",
"vitest": "^2.1.8",
"vite": "^6.1.0",
"vitest": "^3.0.5",
"webpack": "^5.97.1",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
Expand Down
13 changes: 9 additions & 4 deletions packages/react/src/avatar/fallback/AvatarFallback.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as React from 'react';
import { Mock } from 'vitest';
import { Avatar } from '@base-ui-components/react/avatar';
import { describeConformance, createRenderer } from '#test-utils';
import { waitFor } from '@mui/internal-test-utils';
import { describeConformance, createRenderer, isJSDOM } from '#test-utils';
import { useImageLoadingStatus } from '../image/useImageLoadingStatus';

vi.mock('../image/useImageLoadingStatus');
Expand Down Expand Up @@ -30,7 +31,9 @@ describe('<Avatar.Fallback />', () => {
</Avatar.Root>,
);

expect(queryByTestId('fallback')).to.equal(null);
await waitFor(() => {
expect(queryByTestId('fallback')).to.equal(null);
});
});

it('should render the fallback if the image fails to load', async () => {
Expand All @@ -43,10 +46,12 @@ describe('<Avatar.Fallback />', () => {
</Avatar.Root>,
);

expect(queryByText('AC')).to.not.equal(null);
await waitFor(() => {
expect(queryByText('AC')).not.to.equal(null);
});
});

describe('prop: delay', () => {
describe.skipIf(!isJSDOM)('prop: delay', () => {
const { clock, render: renderFakeTimers } = createRenderer();

clock.withFakeTimers();
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/menu/root/MenuRoot.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1135,9 +1135,9 @@ describe('<Menu.Root />', () => {
});
});

it('should close the menu when the trigger is no longer hovered', async () => {
it.skipIf(!isJSDOM)('should close the menu when the trigger is no longer hovered', async () => {
const { getByRole, queryByRole } = await render(
<Menu.Root openOnHover delay={0}>
<Menu.Root openOnHover delay={0} modal={false}>
<Menu.Trigger>Open</Menu.Trigger>
<Menu.Portal>
<Menu.Positioner>
Expand Down
Loading

0 comments on commit fc0cf54

Please sign in to comment.