(non-working) UserMenu data-testids.
This commit is contained in:
parent
f7fc03cdc9
commit
a71a1c5c93
1 changed files with 10 additions and 3 deletions
|
|
@ -58,6 +58,7 @@ export function UserMenu({
|
||||||
key: "user",
|
key: "user",
|
||||||
icon: UserIcon,
|
icon: UserIcon,
|
||||||
label: displayName,
|
label: displayName,
|
||||||
|
dataTestid: "usermenu_user",
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isPasswordlessUser && !preventNavigation) {
|
if (isPasswordlessUser && !preventNavigation) {
|
||||||
|
|
@ -65,6 +66,7 @@ export function UserMenu({
|
||||||
key: "login",
|
key: "login",
|
||||||
label: t("Sign in"),
|
label: t("Sign in"),
|
||||||
icon: LoginIcon,
|
icon: LoginIcon,
|
||||||
|
dataTestid: "usermenu_login",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,6 +75,7 @@ export function UserMenu({
|
||||||
key: "logout",
|
key: "logout",
|
||||||
label: t("Sign out"),
|
label: t("Sign out"),
|
||||||
icon: LogoutIcon,
|
icon: LogoutIcon,
|
||||||
|
dataTestid: "usermenu_logout",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -93,7 +96,11 @@ export function UserMenu({
|
||||||
return (
|
return (
|
||||||
<PopoverMenuTrigger placement="bottom right">
|
<PopoverMenuTrigger placement="bottom right">
|
||||||
<TooltipTrigger tooltip={tooltip} placement="bottom left">
|
<TooltipTrigger tooltip={tooltip} placement="bottom left">
|
||||||
<Button variant="icon" className={styles.userButton}>
|
<Button
|
||||||
|
variant="icon"
|
||||||
|
className={styles.userButton}
|
||||||
|
data-testid="usermenu_open"
|
||||||
|
>
|
||||||
{isAuthenticated && (!isPasswordlessUser || avatarUrl) ? (
|
{isAuthenticated && (!isPasswordlessUser || avatarUrl) ? (
|
||||||
<Avatar
|
<Avatar
|
||||||
size={Size.SM}
|
size={Size.SM}
|
||||||
|
|
@ -108,8 +115,8 @@ export function UserMenu({
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
{(props) => (
|
{(props) => (
|
||||||
<Menu {...props} label={t("User menu")} onAction={onAction}>
|
<Menu {...props} label={t("User menu")} onAction={onAction}>
|
||||||
{items.map(({ key, icon: Icon, label }) => (
|
{items.map(({ key, icon: Icon, label, dataTestid }) => (
|
||||||
<Item key={key} textValue={label}>
|
<Item key={key} textValue={label} data-testid={dataTestid}>
|
||||||
<Icon width={24} height={24} className={styles.menuIcon} />
|
<Icon width={24} height={24} className={styles.menuIcon} />
|
||||||
<Body overflowEllipsis>{label}</Body>
|
<Body overflowEllipsis>{label}</Body>
|
||||||
</Item>
|
</Item>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue