From 930852cd882b33bd827bc139dd98b9475e91f0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=8F=D0=BD=20=D0=9C=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Fri, 8 Apr 2022 14:11:37 -0500 Subject: [PATCH] fix: Adds testId for context menu items and ids to some components. Needed to revive the lobby tests. --- .../base/components/context-menu/ContextMenuItem.js | 7 +++++++ .../features/notifications/components/web/Notification.js | 2 +- .../components/web/LobbyParticipantItems.js | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/react/features/base/components/context-menu/ContextMenuItem.js b/react/features/base/components/context-menu/ContextMenuItem.js index 0460b6d107..e449c01c27 100644 --- a/react/features/base/components/context-menu/ContextMenuItem.js +++ b/react/features/base/components/context-menu/ContextMenuItem.js @@ -56,6 +56,11 @@ export type Props = { */ onKeyPress?: Function, + /** + * TestId of the element, if any. + */ + testId?: string, + /** * Action text. */ @@ -112,6 +117,7 @@ const ContextMenuItem = ({ onClick, onKeyDown, onKeyPress, + testId, text, textClassName }: Props) => { const styles = useStyles(); @@ -126,6 +132,7 @@ const ContextMenuItem = ({ disabled && styles.contextMenuItemDisabled, className ) } + data-testid = { testId } id = { id } key = { text } onClick = { disabled ? undefined : onClick } diff --git a/react/features/notifications/components/web/Notification.js b/react/features/notifications/components/web/Notification.js index 9996e2b907..bbf345c429 100644 --- a/react/features/notifications/components/web/Notification.js +++ b/react/features/notifications/components/web/Notification.js @@ -60,7 +60,7 @@ class Notification extends AbstractNotification { description = { this._renderDescription() } icon = { this._mapAppearanceToIcon() } id = { uid } - testId = { titleKey } + testId = { titleKey || this._getDescriptionKey() } title = { title || t(titleKey, titleArguments) } /> ); } diff --git a/react/features/participants-pane/components/web/LobbyParticipantItems.js b/react/features/participants-pane/components/web/LobbyParticipantItems.js index 596eb75f94..6f04d0ba87 100644 --- a/react/features/participants-pane/components/web/LobbyParticipantItems.js +++ b/react/features/participants-pane/components/web/LobbyParticipantItems.js @@ -31,7 +31,7 @@ type Props = { function LobbyParticipantItems({ openDrawerForParticipant, overflowDrawer, participants }: Props) { return ( -
+
{participants.map(p => (