Work around data-testid issue by tagging the icon not the Item.
This commit is contained in:
@@ -116,8 +116,13 @@ export function UserMenu({
|
|||||||
{(props) => (
|
{(props) => (
|
||||||
<Menu {...props} label={t("User menu")} onAction={onAction}>
|
<Menu {...props} label={t("User menu")} onAction={onAction}>
|
||||||
{items.map(({ key, icon: Icon, label, dataTestid }) => (
|
{items.map(({ key, icon: Icon, label, dataTestid }) => (
|
||||||
<Item key={key} textValue={label} data-testid={dataTestid}>
|
<Item key={key} textValue={label}>
|
||||||
<Icon width={24} height={24} className={styles.menuIcon} />
|
<Icon
|
||||||
|
width={24}
|
||||||
|
height={24}
|
||||||
|
className={styles.menuIcon}
|
||||||
|
data-testid={dataTestid}
|
||||||
|
/>
|
||||||
<Body overflowEllipsis>{label}</Body>
|
<Body overflowEllipsis>{label}</Body>
|
||||||
</Item>
|
</Item>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ export function ProfileModal({ client, ...rest }: Props) {
|
|||||||
placeholder={t("Display name")}
|
placeholder={t("Display name")}
|
||||||
value={displayName}
|
value={displayName}
|
||||||
onChange={onChangeDisplayName}
|
onChange={onChangeDisplayName}
|
||||||
|
data-testid="profile_displayname"
|
||||||
/>
|
/>
|
||||||
</FieldRow>
|
</FieldRow>
|
||||||
{error && (
|
{error && (
|
||||||
@@ -130,7 +131,11 @@ export function ProfileModal({ client, ...rest }: Props) {
|
|||||||
<Button type="button" variant="secondary" onPress={onClose}>
|
<Button type="button" variant="secondary" onPress={onClose}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="submit" disabled={loading}>
|
<Button
|
||||||
|
type="submit"
|
||||||
|
disabled={loading}
|
||||||
|
data-testid="profile_submit"
|
||||||
|
>
|
||||||
{loading ? t("Saving…") : t("Save")}
|
{loading ? t("Saving…") : t("Save")}
|
||||||
</Button>
|
</Button>
|
||||||
</FieldRow>
|
</FieldRow>
|
||||||
|
|||||||
Reference in New Issue
Block a user