From b833a2f862084258b9a7c4faf789b008141f1520 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 10 Sep 2024 14:31:29 +1000 Subject: [PATCH] test: disable animations for ctx menu on integration tests --- ts/components/calling/CallButtons.tsx | 7 ++++--- .../message/message-content/MessageContextMenu.tsx | 7 ++++++- ts/components/menu/ConversationListItemContextMenu.tsx | 3 ++- ts/components/menu/MenuAnimation.ts | 5 +++++ ts/components/menu/MessageRequestBannerContextMenu.tsx | 3 ++- 5 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 ts/components/menu/MenuAnimation.ts diff --git a/ts/components/calling/CallButtons.tsx b/ts/components/calling/CallButtons.tsx index c802337e8..f08381679 100644 --- a/ts/components/calling/CallButtons.tsx +++ b/ts/components/calling/CallButtons.tsx @@ -11,6 +11,7 @@ import { SessionIconButton } from '../icon'; import { DropDownAndToggleButton } from '../icon/DropDownAndToggleButton'; import { SessionContextMenuContainer } from '../SessionContextMenuContainer'; import { ItemWithDataTestId } from '../menu/items/MenuItemWithDataTestId'; +import { getMenuAnimation } from '../menu/MenuAnimation'; const VideoInputMenu = ({ triggerId, @@ -21,7 +22,7 @@ const VideoInputMenu = ({ }) => { return ( - + {camerasList.map(m => { return ( { return ( - + {audioInputsList.map(m => { return ( { return ( - + {audioOutputsList.map(m => { return ( { )} - + {enableReactions && ( // eslint-disable-next-line @typescript-eslint/no-misused-promises return ( - + {/* Message request related actions */} diff --git a/ts/components/menu/MenuAnimation.ts b/ts/components/menu/MenuAnimation.ts new file mode 100644 index 000000000..114b8932f --- /dev/null +++ b/ts/components/menu/MenuAnimation.ts @@ -0,0 +1,5 @@ +import { isTestIntegration } from '../../shared/env_vars'; + +export function getMenuAnimation() { + return isTestIntegration() ? false : ('fade' as const); +} diff --git a/ts/components/menu/MessageRequestBannerContextMenu.tsx b/ts/components/menu/MessageRequestBannerContextMenu.tsx index 053fadfb7..4e8597b77 100644 --- a/ts/components/menu/MessageRequestBannerContextMenu.tsx +++ b/ts/components/menu/MessageRequestBannerContextMenu.tsx @@ -5,6 +5,7 @@ import { SessionContextMenuContainer } from '../SessionContextMenuContainer'; import { hideMessageRequestBanner } from '../../state/ducks/userConfig'; import { ItemWithDataTestId } from './items/MenuItemWithDataTestId'; +import { getMenuAnimation } from './MenuAnimation'; export type PropsContextConversationItem = { triggerId: string; @@ -28,7 +29,7 @@ export const MessageRequestBannerContextMenu = (props: PropsContextConversationI return ( - +