diff options
| author | Adam Soltys <[email protected]> | 2026-02-26 13:36:28 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-26 13:36:28 -0800 |
| commit | a5faa64ba470f935ea3e7932feece3cd9fbadb90 (patch) | |
| tree | 79ec7d6cb2038b5920d5cca977a244fbb189923c /test/e2e/custodial-bitcoin-send.spec.ts | |
| parent | b137cdfca84cf68a2b8a620ba1c55337e88a0050 (diff) | |
| download | coinos-ui-a5faa64ba470f935ea3e7932feece3cd9fbadb90.tar.gz coinos-ui-a5faa64ba470f935ea3e7932feece3cd9fbadb90.zip | |
ark tests
Diffstat (limited to 'test/e2e/custodial-bitcoin-send.spec.ts')
| -rw-r--r-- | test/e2e/custodial-bitcoin-send.spec.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/e2e/custodial-bitcoin-send.spec.ts b/test/e2e/custodial-bitcoin-send.spec.ts index c8543dac..23428abc 100644 --- a/test/e2e/custodial-bitcoin-send.spec.ts +++ b/test/e2e/custodial-bitcoin-send.spec.ts @@ -52,17 +52,20 @@ test("custodial-to-custodial via bitcoin address sends internally and notifies r const amountInput = bobPage.locator('[aria-label="Amount input"]'); await expect(amountInput).toBeVisible({ timeout: 5_000 }); - // Switch to sats mode if in fiat mode (click swap if lightning icon is not visible next to input) + // Ensure sats mode: swap button shows lightning icon when in fiat mode const swapButton = bobPage.locator('[aria-label="Swap currency display"]'); - const swapText = await swapButton.innerText(); - if (swapText.includes("⚡") || swapText.includes("lightning")) { - await swapButton.click(); + if (await swapButton.isVisible({ timeout: 2_000 }).catch(() => false)) { + const hasLightning = await swapButton.locator('iconify-icon[icon="ph:lightning-fill"]').count(); + if (hasLightning > 0) { + await swapButton.click(); + await bobPage.waitForTimeout(300); + } } // Type amount using keyboard await amountInput.click(); await bobPage.keyboard.press("Control+a"); - await bobPage.keyboard.type("1000"); + await bobPage.keyboard.type("100"); // Click "Next" to set the amount const nextButton = bobPage.locator('button[type="button"].btn-accent'); @@ -75,7 +78,7 @@ test("custodial-to-custodial via bitcoin address sends internally and notifies r await sendButton.click(); // Bob should be redirected to /sent/ after successful payment - await bobPage.waitForURL(/\/sent\//, { timeout: 15_000 }); + await bobPage.waitForURL(/\/sent\//, { timeout: 30_000 }); console.log(`[e2e] Bob payment sent: ${bobPage.url()}`); // --- Verify Alice receives notification and is redirected to /paid --- |
