Skip to content

Commit a812114

Browse files
committed
feat: add test ids for tokens table list lw-10959
1 parent 6fca8b4 commit a812114

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

src/design-system/assets-table/assets-table-token-amount.component.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ export const TokenAmount = ({
1616
}: Readonly<Props>): JSX.Element => {
1717
return (
1818
<Flex flexDirection="column" alignItems="flex-end" className={cx.container}>
19-
<Text.Body.Large weight="$semibold">{amount}</Text.Body.Large>
19+
<Text.Body.Large weight="$semibold" data-testid="token-amount">
20+
{amount}
21+
</Text.Body.Large>
2022
<Text.Body.Normal color="secondary" weight="$semibold">
2123
{fiatPrice}
2224
</Text.Body.Normal>

src/design-system/assets-table/assets-table-token-profile.component.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,19 @@ export const TokenProfile = ({
2323
<Grid columns="$fitContent" gutters="$0">
2424
<Cell>
2525
<Box mr="$24">
26-
<Image imageSrc={imageSrc} alt={name} />
26+
<Image imageSrc={imageSrc} alt={name} testId="token-icon" />
2727
</Box>
2828
</Cell>
2929
<Cell>
30-
<Text.Body.Large weight="$semibold">{name}</Text.Body.Large>
30+
<Text.Body.Large weight="$semibold" data-testid="token-name">
31+
{name}
32+
</Text.Body.Large>
3133
<Box>
32-
<Text.Body.Normal color="secondary" weight="$semibold">
34+
<Text.Body.Normal
35+
color="secondary"
36+
weight="$semibold"
37+
data-testid="token-ticker"
38+
>
3339
{description}
3440
</Text.Body.Normal>
3541
</Box>

src/design-system/profile-picture/image.component.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface Props {
1212
alt?: string;
1313
delayMs?: number;
1414
selected?: boolean;
15+
testId?: string;
1516
}
1617

1718
export const Image = ({
@@ -20,13 +21,19 @@ export const Image = ({
2021
alt,
2122
delayMs = 600,
2223
selected,
24+
testId = 'image',
2325
}: Readonly<Props>): JSX.Element => (
2426
<RadixUIAvatar.Root
2527
className={classNames(cx.root, cx.container, {
2628
[cx.selected]: selected,
2729
})}
2830
>
29-
<RadixUIAvatar.Image className={cx.image} src={imageSrc} alt={alt} />
31+
<RadixUIAvatar.Image
32+
className={cx.image}
33+
src={imageSrc}
34+
alt={alt}
35+
data-testid={testId}
36+
/>
3037
<RadixUIAvatar.Fallback delayMs={delayMs}>
3138
{fallback}
3239
</RadixUIAvatar.Fallback>

0 commit comments

Comments
 (0)