diff options
Diffstat (limited to 'test/e2e/vault-send-bitcoin.spec.ts')
| -rw-r--r-- | test/e2e/vault-send-bitcoin.spec.ts | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/test/e2e/vault-send-bitcoin.spec.ts b/test/e2e/vault-send-bitcoin.spec.ts index bd3d7172..bfb69f3b 100644 --- a/test/e2e/vault-send-bitcoin.spec.ts +++ b/test/e2e/vault-send-bitcoin.spec.ts @@ -8,9 +8,7 @@ import { pasteAndSend, } from "./helpers"; -test("pasting vault bitcoin address redirects to /send/bitcoin, not /pay", async ({ - browser, -}) => { +test("pasting vault bitcoin address redirects to /send/bitcoin, not /pay", async ({ browser }) => { test.setTimeout(60_000); // --- Alice: generate a vault invoice and grab the address --- @@ -21,24 +19,17 @@ test("pasting vault bitcoin address redirects to /send/bitcoin, not /pay", async ); // Find the bitcoin vault account card and click Receive - const vaultCard = alicePage.locator( - '[data-testid="account-card"][data-account-type="bitcoin"]', - ); + const vaultCard = alicePage.locator('[data-testid="account-card"][data-account-type="bitcoin"]'); await expect(vaultCard.first()).toBeVisible({ timeout: 10_000 }); - const receiveBtn = vaultCard - .first() - .getByTestId("account-receive"); + const receiveBtn = vaultCard.first().getByTestId("account-receive"); await receiveBtn.click(); // Wait for the invoice page await alicePage.waitForURL(/\/invoice\/[^/?#]+/, { timeout: 10_000 }); // Grab the bitcoin address from the invoice text - const invoiceText = await alicePage - .getByTestId("invoice-text") - .first() - .innerText(); + const invoiceText = await alicePage.getByTestId("invoice-text").first().innerText(); const vaultAddress = invoiceText.trim().replace(/\s+/g, ""); expect( vaultAddress.startsWith("bcrt1") || vaultAddress.startsWith("bc1"), @@ -62,14 +53,8 @@ test("pasting vault bitcoin address redirects to /send/bitcoin, not /pay", async console.log(`[e2e] After paste, Bob navigated to: ${finalUrl}`); // Should go to /send/bitcoin, NOT /pay/alice - expect( - finalUrl, - `Expected /send/bitcoin/ URL but got: ${finalUrl}`, - ).toContain("/send/bitcoin/"); - expect( - finalUrl, - `Should NOT redirect to /pay/ but got: ${finalUrl}`, - ).not.toContain("/pay/"); + expect(finalUrl, `Expected /send/bitcoin/ URL but got: ${finalUrl}`).toContain("/send/bitcoin/"); + expect(finalUrl, `Should NOT redirect to /pay/ but got: ${finalUrl}`).not.toContain("/pay/"); await bobContext.close(); }); |
