fix: Adds testId for context menu items and ids to some components.

Needed to revive the lobby tests.
This commit is contained in:
Дамян Минков 2022-04-08 14:11:37 -05:00
parent fcc8e98aad
commit 930852cd88
3 changed files with 9 additions and 2 deletions

View File

@ -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 }

View File

@ -60,7 +60,7 @@ class Notification extends AbstractNotification<Props> {
description = { this._renderDescription() }
icon = { this._mapAppearanceToIcon() }
id = { uid }
testId = { titleKey }
testId = { titleKey || this._getDescriptionKey() }
title = { title || t(titleKey, titleArguments) } />
);
}

View File

@ -31,7 +31,7 @@ type Props = {
function LobbyParticipantItems({ openDrawerForParticipant, overflowDrawer, participants }: Props) {
return (
<div>
<div id = 'lobby-list'>
{participants.map(p => (
<LobbyParticipantItem
key = { p.id }