Skip to content

Commit

Permalink
chore: remove animation from test environments
Browse files Browse the repository at this point in the history
  • Loading branch information
bsunderhus committed Oct 30, 2023
1 parent e966dcf commit 07db9b4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: remove animation from test environments",
"packageName": "@fluentui/react-dialog",
"email": "bernardo.sunderhus@gmail.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,20 @@ export const renderDialog_unstable = (state: DialogState, contextValues: DialogC
<DialogProvider value={contextValues.dialog}>
<DialogSurfaceProvider value={contextValues.dialogSurface}>
{trigger}
<Transition
mountOnEnter
unmountOnExit
in={state.open}
nodeRef={state.dialogRef}
// FIXME: this should not be hardcoded tokens.durationGentle
timeout={250}
>
{status => <DialogTransitionProvider value={status}>{content}</DialogTransitionProvider>}
</Transition>
{process.env.NODE_ENV === 'test' ? (
state.open && <DialogTransitionProvider value={'entered'}>{content}</DialogTransitionProvider>
) : (
<Transition
mountOnEnter
unmountOnExit
in={state.open}
nodeRef={state.dialogRef}
// FIXME: this should not be hardcoded tokens.durationGentle
timeout={250}
>
{status => <DialogTransitionProvider value={status}>{content}</DialogTransitionProvider>}
</Transition>
)}
</DialogSurfaceProvider>
</DialogProvider>
);
Expand Down

0 comments on commit 07db9b4

Please sign in to comment.