From 53db81e1adcbc022f04081bd1c0af8721c30a8e5 Mon Sep 17 00:00:00 2001 From: atomiks Date: Tue, 24 Dec 2024 16:59:04 +1100 Subject: [PATCH] Remove keepMounted prop in tests --- docs/reference/generated/menu-portal.json | 2 +- docs/reference/generated/popover-portal.json | 2 +- .../generated/preview-card-portal.json | 2 +- docs/reference/generated/tooltip-portal.json | 2 +- docs/src/app/(private)/experiments/dialog.tsx | 33 +++++++------------ .../app/(private)/experiments/menu-rtl.tsx | 18 +++------- .../experiments/popup-transform-origin.tsx | 20 ++++++----- .../src/app/(private)/experiments/tooltip.tsx | 14 ++++---- .../src/dialog/popup/DialogPopup.test.tsx | 4 +-- .../react/src/dialog/root/DialogRoot.test.tsx | 5 ++- .../checkbox-item/MenuCheckboxItem.test.tsx | 2 +- packages/react/src/menu/portal/MenuPortal.tsx | 2 -- .../menu/positioner/MenuPositioner.test.tsx | 4 +-- .../src/menu/positioner/useMenuPositioner.ts | 8 ++--- .../menu/radio-item/MenuRadioItem.test.tsx | 2 +- .../react/src/menu/root/MenuRoot.test.tsx | 6 ++-- .../src/popover/portal/PopoverPortal.tsx | 2 -- .../positioner/PopoverPositioner.test.tsx | 14 ++++++-- .../positioner/usePopoverPositioner.tsx | 8 ++--- .../src/popover/root/PopoverRoot.test.tsx | 10 +++--- .../preview-card/portal/PreviewCardPortal.tsx | 2 -- .../positioner/usePreviewCardPositioner.ts | 8 ++--- .../root/PreviewCardRoot.test.tsx | 2 +- .../src/tooltip/portal/TooltipPortal.tsx | 2 -- .../positioner/useTooltipPositioner.ts | 8 ++--- 25 files changed, 82 insertions(+), 100 deletions(-) diff --git a/docs/reference/generated/menu-portal.json b/docs/reference/generated/menu-portal.json index 317c6bba39..5a7bcc3858 100644 --- a/docs/reference/generated/menu-portal.json +++ b/docs/reference/generated/menu-portal.json @@ -9,7 +9,7 @@ "keepMounted": { "type": "boolean", "default": "false", - "description": "Whether to keep the portal mounted in the DOM while the popup is hidden.\nwhen the popup is closed." + "description": "Whether to keep the portal mounted in the DOM while the popup is hidden." } }, "dataAttributes": {}, diff --git a/docs/reference/generated/popover-portal.json b/docs/reference/generated/popover-portal.json index 8f8687b8ea..4a4554c421 100644 --- a/docs/reference/generated/popover-portal.json +++ b/docs/reference/generated/popover-portal.json @@ -9,7 +9,7 @@ "keepMounted": { "type": "boolean", "default": "false", - "description": "Whether to keep the portal mounted in the DOM while the popup is hidden.\nwhen the popup is closed." + "description": "Whether to keep the portal mounted in the DOM while the popup is hidden." } }, "dataAttributes": {}, diff --git a/docs/reference/generated/preview-card-portal.json b/docs/reference/generated/preview-card-portal.json index 7f56e0d0d4..34c82e1b85 100644 --- a/docs/reference/generated/preview-card-portal.json +++ b/docs/reference/generated/preview-card-portal.json @@ -9,7 +9,7 @@ "keepMounted": { "type": "boolean", "default": "false", - "description": "Whether to keep the portal mounted in the DOM while the popup is hidden.\nwhen the popup is closed." + "description": "Whether to keep the portal mounted in the DOM while the popup is hidden." } }, "dataAttributes": {}, diff --git a/docs/reference/generated/tooltip-portal.json b/docs/reference/generated/tooltip-portal.json index 5876bbfa56..41be076137 100644 --- a/docs/reference/generated/tooltip-portal.json +++ b/docs/reference/generated/tooltip-portal.json @@ -9,7 +9,7 @@ "keepMounted": { "type": "boolean", "default": "false", - "description": "Whether to keep the portal mounted in the DOM while the popup is hidden.\nwhen the popup is closed." + "description": "Whether to keep the portal mounted in the DOM while the popup is hidden." } }, "dataAttributes": {}, diff --git a/docs/src/app/(private)/experiments/dialog.tsx b/docs/src/app/(private)/experiments/dialog.tsx index cf2509c77c..1573d4d1c7 100644 --- a/docs/src/app/(private)/experiments/dialog.tsx +++ b/docs/src/app/(private)/experiments/dialog.tsx @@ -74,16 +74,11 @@ function CssTransitionDialogDemo({ keepMounted, modal, dismissible }: DemoProps) Open with CSS transition - - - - + + + {renderContent( 'Dialog with CSS transitions', NESTED_DIALOGS, @@ -106,16 +101,11 @@ function CssAnimationDialogDemo({ keepMounted, modal, dismissible }: DemoProps) Open with CSS animation - - - - + + + {renderContent( 'Dialog with CSS animations', NESTED_DIALOGS, @@ -147,9 +137,8 @@ function ReactSpringDialogDemo({ keepMounted, modal, dismissible }: DemoProps) { /> - + {renderContent( diff --git a/docs/src/app/(private)/experiments/menu-rtl.tsx b/docs/src/app/(private)/experiments/menu-rtl.tsx index ee6ac09979..d1c2b1e2a3 100644 --- a/docs/src/app/(private)/experiments/menu-rtl.tsx +++ b/docs/src/app/(private)/experiments/menu-rtl.tsx @@ -16,13 +16,8 @@ export default function RtlPopover() { - - + + @@ -40,13 +35,8 @@ export default function RtlPopover() { - - + + diff --git a/docs/src/app/(private)/experiments/popup-transform-origin.tsx b/docs/src/app/(private)/experiments/popup-transform-origin.tsx index 98b804e5d2..97731bc862 100644 --- a/docs/src/app/(private)/experiments/popup-transform-origin.tsx +++ b/docs/src/app/(private)/experiments/popup-transform-origin.tsx @@ -9,9 +9,11 @@ function Popover({ side }: { side: Side }) { {side} - - - + + + + + ); } @@ -22,11 +24,13 @@ function PopoverWithArrow({ side }: { side: Side }) { {side} - - - - - + + + + + + + ); } diff --git a/docs/src/app/(private)/experiments/tooltip.tsx b/docs/src/app/(private)/experiments/tooltip.tsx index 41f2052d06..e205e70991 100644 --- a/docs/src/app/(private)/experiments/tooltip.tsx +++ b/docs/src/app/(private)/experiments/tooltip.tsx @@ -227,7 +227,7 @@ export default function TooltipTransitionExperiment() { Anchor - + Tooltip @@ -237,7 +237,7 @@ export default function TooltipTransitionExperiment() { Anchor - + Tooltip @@ -250,7 +250,7 @@ export default function TooltipTransitionExperiment() { Anchor - + Tooltip @@ -264,7 +264,7 @@ export default function TooltipTransitionExperiment() { Anchor - + Tooltip @@ -274,7 +274,7 @@ export default function TooltipTransitionExperiment() { Anchor - + Tooltip @@ -287,7 +287,7 @@ export default function TooltipTransitionExperiment() { Anchor - + Tooltip @@ -311,7 +311,7 @@ function FramerMotion() { {isOpen && ( - + ', () => { it(`should ${!expectedIsMounted ? 'not ' : ''}keep the dialog mounted when keepMounted=${keepMounted}`, async () => { const { queryByRole } = await render( - - + + , ); diff --git a/packages/react/src/dialog/root/DialogRoot.test.tsx b/packages/react/src/dialog/root/DialogRoot.test.tsx index 9ffb90aeab..b9a4f2b9f1 100644 --- a/packages/react/src/dialog/root/DialogRoot.test.tsx +++ b/packages/react/src/dialog/root/DialogRoot.test.tsx @@ -133,7 +133,6 @@ describe('', () => { className="animation-test-popup" data-testid="popup" onAnimationEnd={notifyAnimationFinished} - keepMounted /> @@ -399,8 +398,8 @@ describe('', () => { {/* eslint-disable-next-line react/no-danger */}