From d043b86310585e215eb07f4702a4be3456315999 Mon Sep 17 00:00:00 2001 From: Ivan Vershigora Date: Fri, 22 May 2026 12:41:20 +0100 Subject: [PATCH] tst: manage wallets --- components/ManageWalletsListItem.tsx | 1 + components/WalletListItem.tsx | 2 +- screen/wallets/ManageWallets.tsx | 2 +- tests/e2e/bluewallet.spec.js | 27 +++++++++++++++++++++++++++ tests/e2e/bluewallet2.spec.js | 12 ++++++++++-- 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/components/ManageWalletsListItem.tsx b/components/ManageWalletsListItem.tsx index dae7ccfe7..659475075 100644 --- a/components/ManageWalletsListItem.tsx +++ b/components/ManageWalletsListItem.tsx @@ -153,6 +153,7 @@ const ManageWalletsListItem: React.FC = ({ ]} onPress={onToggle} accessibilityRole="button" + testID={isHidden ? 'SwipeShowBalance' : 'SwipeHideBalance'} > {isHidden ? loc.wallets.swipe_balance_show : loc.wallets.swipe_balance_hide} diff --git a/components/WalletListItem.tsx b/components/WalletListItem.tsx index 9da5b53be..03bfe6024 100644 --- a/components/WalletListItem.tsx +++ b/components/WalletListItem.tsx @@ -107,7 +107,7 @@ const WalletListItem: React.FC = ({ )} {wallet.hideBalance ? ( - + ) : ( diff --git a/screen/wallets/ManageWallets.tsx b/screen/wallets/ManageWallets.tsx index 44b9d94fa..6c38e0758 100644 --- a/screen/wallets/ManageWallets.tsx +++ b/screen/wallets/ManageWallets.tsx @@ -593,7 +593,7 @@ const ManageWallets: React.FC = () => { const hintTextColor = dark ? colors.foregroundColor : colors.alternativeTextColor; return ( - + diff --git a/tests/e2e/bluewallet.spec.js b/tests/e2e/bluewallet.spec.js index 3b1d1a1b6..b17610a60 100644 --- a/tests/e2e/bluewallet.spec.js +++ b/tests/e2e/bluewallet.spec.js @@ -275,6 +275,33 @@ describe('BlueWallet UI Tests - no wallets', () => { await waitForId('BitcoinAddressQRCode'); await waitForId('CopyTextToClipboard'); + // ManageWallets: relaunch to clear receive modal, then open via long-press, swipe-to-hide, verify persists across restart + await device.launchApp({ newInstance: true }); + await waitForId('WalletsList'); + await element(by.id('cr34t3d')).longPress(); + await waitForId('NavigationCloseButton'); + await expect(element(by.id('cr34t3d'))).toBeVisible(); + + // swipe wallet row left to reveal Hide action; tap it + await element(by.id('cr34t3d')).swipe('left', 'slow', 0.6); + await waitForId('SwipeHideBalance'); + await element(by.id('SwipeHideBalance')).tap(); + await element(by.id('NavigationCloseButton')).tap(); + await waitForId('WalletsList'); + + // restart app — hide state must persist; swipe-left now exposes "Show" (hideBalance persisted as true) + await device.launchApp({ newInstance: true }); + await waitForId('WalletsList'); + await element(by.id('cr34t3d')).longPress(); + await waitForId('NavigationCloseButton'); + await element(by.id('cr34t3d')).swipe('left', 'slow', 0.6); + await waitForId('SwipeShowBalance'); + + // restore visible state so subsequent tests are clean + await element(by.id('SwipeShowBalance')).tap(); + await element(by.id('NavigationCloseButton')).tap(); + await waitForId('WalletsList'); + process.env.CI && require('fs').writeFileSync(lockFile, '1'); }); diff --git a/tests/e2e/bluewallet2.spec.js b/tests/e2e/bluewallet2.spec.js index 7764b1433..49cda0125 100644 --- a/tests/e2e/bluewallet2.spec.js +++ b/tests/e2e/bluewallet2.spec.js @@ -568,7 +568,6 @@ describe('BlueWallet UI Tests - import BIP84 wallet', () => { await waitForKeyboardToClose(); await goBack(); await waitForText('testname'); - await expect(element(by.id('WalletLabel'))).toHaveText('testname'); await element(by.id('WalletDetails')).tap(); // rename back @@ -578,7 +577,6 @@ describe('BlueWallet UI Tests - import BIP84 wallet', () => { await waitForKeyboardToClose(); await goBack(); await waitForText('Imported HD SegWit (BIP84 Bech32 Native)'); - await expect(element(by.id('WalletLabel'))).toHaveText('Imported HD SegWit (BIP84 Bech32 Native)'); await element(by.id('WalletDetails')).tap(); // wallet export @@ -599,6 +597,16 @@ describe('BlueWallet UI Tests - import BIP84 wallet', () => { .scroll(500, 'down'); await tapAndTapAgainIfElementIsNotVisible('XpubButton', 'CopyTextToClipboard'); await goBack(); + await goBack(); + await goBack(); + + // ManageWallets — open via long-press, verify header + drag hint render + await waitForId('WalletsList'); + await element(by.text('Imported HD SegWit (BIP84 Bech32 Native)')).longPress(); + await waitForId('NavigationCloseButton'); + await expect(element(by.id('Imported HD SegWit (BIP84 Bech32 Native)'))).toBeVisible(); + await element(by.id('NavigationCloseButton')).tap(); + await waitForId('WalletsList'); process.env.CI && require('fs').writeFileSync(lockFile, '1'); });