From a7f71a49b1d22725b1b400fb50c306c8ca0f3e4e Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Thu, 17 Sep 2026 19:20:56 -0300 Subject: [PATCH] test: dismiss confirmed-only receive sheet in boost_1 Co-Authored-By: Claude Opus 5 (1M context) --- test/helpers/actions.ts | 17 +++++++++++++++++ test/specs/boost.e2e.ts | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index ae045e4b..1813e98e 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -1444,6 +1444,23 @@ export async function acknowledgeReceivedPayment({ timeout = 30_000 }: { timeout await sleep(300); } +/** Dismisses the received payment sheet when it shows, and does nothing when it does not. + * + * Use this where the sheet is platform- or build-dependent, such as a deposit the wallet first sees + * already confirmed (synonymdev/bitkit-android#797), which Android notifies and iOS does not yet. + */ +export async function dismissReceivedPaymentIfShown({ + timeout = 20_000, +}: { timeout?: number } = {}): Promise { + try { + await acknowledgeReceivedPayment({ timeout }); + return true; + } catch { + console.info('→ No received payment sheet shown, continuing.'); + return false; + } +} + export async function acknowledgeReceivedPaymentIfPresent(): Promise { if (getBackend() === 'local') { await acknowledgeReceivedPayment(); diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index e7abf5a2..e2c9c979 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -15,6 +15,7 @@ import { restoreWallet, enterAddress, waitForToast, + dismissReceivedPaymentIfShown, } from '../helpers/actions'; import initElectrum from '../helpers/electrum'; import { reinstallApp } from '../helpers/setup'; @@ -111,6 +112,11 @@ describe('@boost - Boost', () => { // mine new block await mineBlocks(1); + + // the restored wallet never saw the boosted tx in the mempool, so this confirmation is its + // first sight of the deposit and the received sheet opens over the screen + await dismissReceivedPaymentIfShown(); + await doNavigationClose(); await sleep(500);