Skip to content

Commit

Permalink
WIP fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Aug 15, 2024
1 parent 94dc432 commit 0172ef8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { describeConformance } from '../../../test/describeConformance';
import type { CollapsibleContextValue } from '../Root/CollapsibleRoot.types';

const contextValue: CollapsibleContextValue = {
animated: false,
contentId: 'ContentId',
disabled: false,
mounted: true,
Expand Down
10 changes: 7 additions & 3 deletions packages/mui-base/src/Collapsible/Root/CollapsibleRoot.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ describe('<Collapsible.Root />', () => {
});

describe('prop: htmlHidden', () => {
it('supports "hidden until found" state', async () => {
it('supports "hidden until found" state', async function test() {
if (!('onbeforematch' in window)) {
this.skip();
}

const handleOpenChange = spy();

const { getByTestId } = await render(
Expand All @@ -136,8 +140,8 @@ describe('<Collapsible.Root />', () => {
const event = new window.Event('beforematch', {
bubbles: true,
cancelable: false,
srcElement: content,
target: content,
// srcElement: content,
// target: content,
});
content.dispatchEvent(event);
});
Expand Down
12 changes: 11 additions & 1 deletion packages/mui-base/src/Collapsible/Root/useCollapsibleRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,17 @@ function useCollapsibleRoot(
setOpen,
transitionStatus,
}),
[contentId, disabled, mounted, open, setContentId, setMounted, setOpen, transitionStatus],
[
animated,
contentId,
disabled,
mounted,
open,
setContentId,
setMounted,
setOpen,
transitionStatus,
],
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { describeConformance } from '../../../test/describeConformance';
import type { CollapsibleContextValue } from '../Root/CollapsibleRoot.types';

const contextValue: CollapsibleContextValue = {
animated: false,
contentId: 'ContentId',
disabled: false,
mounted: true,
Expand Down

0 comments on commit 0172ef8

Please sign in to comment.