From 810397f30abca4e9c95d576fa9f2a0e1501a3192 Mon Sep 17 00:00:00 2001 From: Ryan W Date: Mon, 16 Dec 2024 15:09:09 -0500 Subject: [PATCH 1/3] chore: add data-testids to account mgmt UI --- src/pages/Accounts/AccountDetailsView.tsx | 2 ++ src/pages/Accounts/Accounts.tsx | 13 +++++++++++-- src/pages/Accounts/components/AccountName.tsx | 1 + src/pages/Accounts/components/RenameDialog.tsx | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/pages/Accounts/AccountDetailsView.tsx b/src/pages/Accounts/AccountDetailsView.tsx index 3b5d7d2c..b77c0c74 100644 --- a/src/pages/Accounts/AccountDetailsView.tsx +++ b/src/pages/Accounts/AccountDetailsView.tsx @@ -116,6 +116,7 @@ export const AccountDetailsView = () => { }} > history.replace('/accounts')} sx={{ padding: 0.25, @@ -134,6 +135,7 @@ export const AccountDetailsView = () => { {account.name} diff --git a/src/pages/Accounts/Accounts.tsx b/src/pages/Accounts/Accounts.tsx index c9b3862c..2d5ccb80 100644 --- a/src/pages/Accounts/Accounts.tsx +++ b/src/pages/Accounts/Accounts.tsx @@ -133,6 +133,7 @@ export function Accounts() { }, }} disableRipple + data-testid="accounts-back-btn" > @@ -151,7 +152,11 @@ export function Accounts() { gap: 2, }} > - + {t('Currently using {{walletName}}', { walletName: isPrimaryAccount(active) ? walletDetails?.name @@ -183,7 +188,11 @@ export function Accounts() { gap: 2, }} > - + {active?.name} diff --git a/src/pages/Accounts/components/AccountName.tsx b/src/pages/Accounts/components/AccountName.tsx index 0232da12..e69c1012 100644 --- a/src/pages/Accounts/components/AccountName.tsx +++ b/src/pages/Accounts/components/AccountName.tsx @@ -69,6 +69,7 @@ export default function AccountName({ e.stopPropagation(); promptRename(); }} + data-testid="rename-account-btn" > diff --git a/src/pages/Accounts/components/RenameDialog.tsx b/src/pages/Accounts/components/RenameDialog.tsx index 9b3c8226..d4804f05 100644 --- a/src/pages/Accounts/components/RenameDialog.tsx +++ b/src/pages/Accounts/components/RenameDialog.tsx @@ -61,6 +61,7 @@ export const RenameDialog = ({ ), }} {...keyboardShortcuts} + data-testid="rename-account-input" /> Date: Mon, 16 Dec 2024 18:18:25 -0500 Subject: [PATCH 2/3] fix: more ids for wallet header --- src/pages/Accounts/components/WalletHeader.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/Accounts/components/WalletHeader.tsx b/src/pages/Accounts/components/WalletHeader.tsx index 1cf32ec9..6f78eb36 100644 --- a/src/pages/Accounts/components/WalletHeader.tsx +++ b/src/pages/Accounts/components/WalletHeader.tsx @@ -88,6 +88,7 @@ export default function WalletHeader({ fontSize={14} fontWeight={600} lineHeight="16px" + data-testid="wallet-name" > {walletDetails?.name ?? name} @@ -97,6 +98,7 @@ export default function WalletHeader({ sx={{ fontSize: 10, height: 16 }} color="success" label={t('Active')} + data-testid="wallet-active-chip" /> {/* Section for the imported accounts has no WalletDetails, therefore cannot be renamed */} From 884721a8229e09c5cf2cb3e3d010ef7f2d2d77fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Leszczyk?= Date: Tue, 17 Dec 2024 09:01:56 +0100 Subject: [PATCH 3/3] fix: lint --- src/pages/Accounts/components/AccountItem.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/Accounts/components/AccountItem.tsx b/src/pages/Accounts/components/AccountItem.tsx index 815cc4e1..e47c3731 100644 --- a/src/pages/Accounts/components/AccountItem.tsx +++ b/src/pages/Accounts/components/AccountItem.tsx @@ -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 ( @@ -348,8 +348,8 @@ const getCopyEventNameByNetworkType = (type: NetworkVMType) => { type === NetworkVMType.BITCOIN ? 'Btc' : type === NetworkVMType.EVM - ? 'Eth' - : type; + ? 'Eth' + : type; return `AccountSelector${normalizedType}AddressCopied`; };