From 39f2743c216db3348a3f4086d81a3694efa01c9b Mon Sep 17 00:00:00 2001 From: atomiks Date: Fri, 28 Feb 2025 15:35:03 +1100 Subject: [PATCH] [test] Fix PreviewCard test flake (#1487) --- .../app/(public)/(content)/react/handbook/animation/page.mdx | 2 +- packages/react/src/alert-dialog/root/AlertDialogRoot.test.tsx | 2 +- packages/react/src/dialog/root/DialogRoot.test.tsx | 2 +- packages/react/src/menu/root/MenuRoot.test.tsx | 2 +- packages/react/src/popover/root/PopoverRoot.test.tsx | 2 +- packages/react/src/preview-card/root/PreviewCardRoot.test.tsx | 2 +- packages/react/src/select/root/SelectRoot.test.tsx | 2 +- packages/react/src/tooltip/root/TooltipRoot.test.tsx | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/src/app/(public)/(content)/react/handbook/animation/page.mdx b/docs/src/app/(public)/(content)/react/handbook/animation/page.mdx index 393967a16b..a655a451af 100644 --- a/docs/src/app/(public)/(content)/react/handbook/animation/page.mdx +++ b/docs/src/app/(public)/(content)/react/handbook/animation/page.mdx @@ -183,7 +183,7 @@ function App() { exit={{ scale: 0 }} onAnimationComplete={() => { if (!open) { - action.current.unmount(); + actionsRef.current.unmount(); } }} /> diff --git a/packages/react/src/alert-dialog/root/AlertDialogRoot.test.tsx b/packages/react/src/alert-dialog/root/AlertDialogRoot.test.tsx index 0b572d37a6..82173a0df9 100644 --- a/packages/react/src/alert-dialog/root/AlertDialogRoot.test.tsx +++ b/packages/react/src/alert-dialog/root/AlertDialogRoot.test.tsx @@ -130,7 +130,7 @@ describe('', () => { }); }); - describe('prop: action', () => { + describe('prop: actionsRef', () => { it('unmounts the alert dialog when the `unmount` method is called', async () => { const actionsRef = { current: { diff --git a/packages/react/src/dialog/root/DialogRoot.test.tsx b/packages/react/src/dialog/root/DialogRoot.test.tsx index 1f8ace8a7d..8224d8972f 100644 --- a/packages/react/src/dialog/root/DialogRoot.test.tsx +++ b/packages/react/src/dialog/root/DialogRoot.test.tsx @@ -597,7 +597,7 @@ describe('', () => { }); }); - describe('prop: action', () => { + describe('prop: actionsRef', () => { it('unmounts the dialog when the `unmount` method is called', async () => { const actionsRef = { current: { diff --git a/packages/react/src/menu/root/MenuRoot.test.tsx b/packages/react/src/menu/root/MenuRoot.test.tsx index 27714c7c5a..3319dfc063 100644 --- a/packages/react/src/menu/root/MenuRoot.test.tsx +++ b/packages/react/src/menu/root/MenuRoot.test.tsx @@ -799,7 +799,7 @@ describe('', () => { }); }); - describe('prop: action', () => { + describe('prop: actionsRef', () => { it('unmounts the menu when the `unmount` method is called', async () => { const actionsRef = { current: { diff --git a/packages/react/src/popover/root/PopoverRoot.test.tsx b/packages/react/src/popover/root/PopoverRoot.test.tsx index 7b7d8cbae1..e4c7cce5cc 100644 --- a/packages/react/src/popover/root/PopoverRoot.test.tsx +++ b/packages/react/src/popover/root/PopoverRoot.test.tsx @@ -408,7 +408,7 @@ describe('', () => { }); }); - describe('prop: action', () => { + describe('prop: actionsRef', () => { it('unmounts the popover when the `unmount` method is called', async () => { const actionsRef = { current: { diff --git a/packages/react/src/preview-card/root/PreviewCardRoot.test.tsx b/packages/react/src/preview-card/root/PreviewCardRoot.test.tsx index cebc5b025c..71f0828e17 100644 --- a/packages/react/src/preview-card/root/PreviewCardRoot.test.tsx +++ b/packages/react/src/preview-card/root/PreviewCardRoot.test.tsx @@ -385,7 +385,7 @@ describe('', () => { }); }); - describe('prop: action', () => { + describe.skipIf(isJSDOM)('prop: actionsRef', () => { it('unmounts the preview card when the `unmount` method is called', async () => { const actionsRef = { current: { diff --git a/packages/react/src/select/root/SelectRoot.test.tsx b/packages/react/src/select/root/SelectRoot.test.tsx index 6c73a361e2..ae84e79b98 100644 --- a/packages/react/src/select/root/SelectRoot.test.tsx +++ b/packages/react/src/select/root/SelectRoot.test.tsx @@ -322,7 +322,7 @@ describe('', () => { }); }); - describe('prop: action', () => { + describe('prop: actionsRef', () => { it('unmounts the select when the `unmount` method is called', async () => { const actionsRef = { current: { diff --git a/packages/react/src/tooltip/root/TooltipRoot.test.tsx b/packages/react/src/tooltip/root/TooltipRoot.test.tsx index 81add72f66..16d1f4d58e 100644 --- a/packages/react/src/tooltip/root/TooltipRoot.test.tsx +++ b/packages/react/src/tooltip/root/TooltipRoot.test.tsx @@ -381,7 +381,7 @@ describe('', () => { }); }); - describe('prop: action', () => { + describe('prop: actionsRef', () => { it('unmounts the tooltip when the `unmount` method is called', async () => { const actionsRef = { current: {