Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add data-testids to account mgmt UI #113

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pages/Accounts/AccountDetailsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export const AccountDetailsView = () => {
}}
>
<IconButton
data-testid="account-details-back-btn"
onClick={() => history.replace('/accounts')}
sx={{
padding: 0.25,
Expand All @@ -134,6 +135,7 @@ export const AccountDetailsView = () => {
<OverflowingTypography
variant="h4"
sx={{ mr: 2, fontSize: 24, flexGrow: 1 }}
data-testid="account-details-name"
>
{account.name}
</OverflowingTypography>
Expand Down
13 changes: 11 additions & 2 deletions src/pages/Accounts/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export function Accounts() {
},
}}
disableRipple
data-testid="accounts-back-btn"
>
<ChevronLeftIcon size={32} />
</IconButton>
Expand All @@ -151,7 +152,11 @@ export function Accounts() {
gap: 2,
}}
>
<OverflowingTypography variant="caption" color="text.secondary">
<OverflowingTypography
variant="caption"
color="text.secondary"
data-testid="account-management-active-wallet"
>
{t('Currently using {{walletName}}', {
walletName: isPrimaryAccount(active)
? walletDetails?.name
Expand Down Expand Up @@ -183,7 +188,11 @@ export function Accounts() {
gap: 2,
}}
>
<OverflowingTypography variant="h5" fontSize={18}>
<OverflowingTypography
variant="h5"
fontSize={18}
data-testid="account-management-active-account"
>
{active?.name}
</OverflowingTypography>
<Typography variant="h5" fontSize={18}>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Accounts/components/AccountItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const AccountItem = forwardRef(
type: account.type,
});
},
[address, account.type, capture, network?.vmName, toast]
[address, account.type, capture, network?.vmName, toast],
);

return (
Expand Down Expand Up @@ -348,8 +348,8 @@ const getCopyEventNameByNetworkType = (type: NetworkVMType) => {
type === NetworkVMType.BITCOIN
? 'Btc'
: type === NetworkVMType.EVM
? 'Eth'
: type;
? 'Eth'
: type;

return `AccountSelector${normalizedType}AddressCopied`;
};
1 change: 1 addition & 0 deletions src/pages/Accounts/components/AccountName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default function AccountName({
e.stopPropagation();
promptRename();
}}
data-testid="rename-account-btn"
>
<PencilRoundIcon size={16} />
</IconButton>
Expand Down
1 change: 1 addition & 0 deletions src/pages/Accounts/components/RenameDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const RenameDialog = ({
),
}}
{...keyboardShortcuts}
data-testid="rename-account-input"
/>
</DialogContent>
<Stack
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Accounts/components/WalletHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export default function WalletHeader({
fontSize={14}
fontWeight={600}
lineHeight="16px"
data-testid="wallet-name"
>
{walletDetails?.name ?? name}
</OverflowingTypography>
Expand All @@ -97,6 +98,7 @@ export default function WalletHeader({
sx={{ fontSize: 10, height: 16 }}
color="success"
label={t('Active')}
data-testid="wallet-active-chip"
/>
</Grow>
{/* Section for the imported accounts has no WalletDetails, therefore cannot be renamed */}
Expand Down
Loading