Skip to content
Closed
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
17 changes: 17 additions & 0 deletions test/helpers/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean> {
try {
await acknowledgeReceivedPayment({ timeout });
return true;
} catch {
console.info('→ No received payment sheet shown, continuing.');
return false;
}
}

export async function acknowledgeReceivedPaymentIfPresent(): Promise<boolean> {
if (getBackend() === 'local') {
await acknowledgeReceivedPayment();
Expand Down
6 changes: 6 additions & 0 deletions test/specs/boost.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
restoreWallet,
enterAddress,
waitForToast,
dismissReceivedPaymentIfShown,
} from '../helpers/actions';
import initElectrum from '../helpers/electrum';
import { reinstallApp } from '../helpers/setup';
Expand Down Expand Up @@ -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);

Expand Down