aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-08-30 08:34:27 -0700
committerAdam Soltys <[email protected]>2022-08-30 08:34:27 -0700
commita033edd4a5bb3445ae5f906b7d9d3150349d490b (patch)
tree3256f9e4969a8d6b1cc056bebb12e3de8bf9710d /src
parent8c1497026fbb9a1327d6aae5cf016c58ddb232cf (diff)
downloadcoinos-ui-a033edd4a5bb3445ae5f906b7d9d3150349d490b.tar.gz
coinos-ui-a033edd4a5bb3445ae5f906b7d9d3150349d490b.zip
remove icon dimensions
Diffstat (limited to 'src')
-rw-r--r--src/components/Icon.svelte2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/components/Icon.svelte b/src/components/Icon.svelte
index da32dbf0..58a61033 100644
--- a/src/components/Icon.svelte
+++ b/src/components/Icon.svelte
@@ -3,4 +3,4 @@
export let style;
</script>
-<img src="/icons/{icon}.svg" alt={icon} class={style} style="width: 26px; height: 26px" />
+<img src="/icons/{icon}.svg" alt={icon} class={style} />
/ .highlight .nf { color: #06B; font-weight: bold } /* Name.Function */ .highlight .nl { color: #369; font-style: italic } /* Name.Label */ .highlight .nn { color: #B06; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #369; font-weight: bold } /* Name.Property */ .highlight .nt { color: #B06; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #369 } /* Name.Variable */ .highlight .ow { color: #080 } /* Operator.Word */ .highlight .w { color: #BBB } /* Text.Whitespace */ .highlight .mb { color: #00D; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #00D; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #00D; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #00D; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #00D; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #D20; background-color: #FFF0F0 } /* Literal.String.Affix */ .highlight .sb { color: #D20; background-color: #FFF0F0 } /* Literal.String.Backtick */ .highlight .sc { color: #D20; background-color: #FFF0F0 } /* Literal.String.Char */ .highlight .dl { color: #D20; background-color: #FFF0F0 } /* Literal.String.Delimiter */ .highlight .sd { color: #D20; background-color: #FFF0F0 } /* Literal.String.Doc */ .highlight .s2 { color: #D20; background-color: #FFF0F0 } /* Literal.String.Double */ .highlight .se { color: #04D; background-color: #FFF0F0 } /* Literal.String.Escape */ .highlight .sh { color: #D20; background-color: #FFF0F0 } /* Literal.String.Heredoc */ .highlight .si { color: #33B; background-color: #FFF0F0 } /* Literal.String.Interpol */ .highlight .sx { color: #2B2; background-color: #F0FFF0 } /* Literal.String.Other */ .highlight .sr { color: #080; background-color: #FFF0FF } /* Literal.String.Regex */ .highlight .s1 { color: #D20; background-color: #FFF0F0 } /* Literal.String.Single */ .highlight .ss { color: #A60; background-color: #FFF0F0 } /* Literal.String.Symbol */ .highlight .bp { color: #038 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #06B; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #369 } /* Name.Variable.Class */ .highlight .vg { color: #D70 } /* Name.Variable.Global */ .highlight .vi { color: #33B } /* Name.Variable.Instance */ .highlight .vm { color: #369 } /* Name.Variable.Magic */ .highlight .il { color: #00D; font-weight: bold } /* Literal.Number.Integer.Long */
import { expect, test } from "@playwright/test";
import { apiBaseUrl, bobUsername, bobPassword, login, lightningPay, waitForPageReady } from "./helpers";

test("redirects from /receive to /paid when lightning address payment arrives", async ({
  page,
}) => {
  test.setTimeout(90_000);

  // --- Bob: log in and navigate to receive page ---
  await login(page, bobUsername, bobPassword);
  await page.goto(`/${bobUsername}/receive`);
  await waitForPageReady(page);
  // Wait for the receive page to settle and websocket to connect
  await page.waitForTimeout(3000);
  console.log(`[e2e] Bob on receive page: ${page.url()}`);

  // Ensure we're on the receive page (not redirected to an invoice)
  expect(page.url()).toContain(`/${bobUsername}/receive`);

  // --- External: create and pay LNURL invoice ---
  // Step 1: Fetch LNURL pay request
  const lnurlRes = await page.request.get(`${apiBaseUrl}/lnurlp/${bobUsername}`);
  const lnurlData = await lnurlRes.json();
  expect(lnurlData.callback).toBeTruthy();
  console.log(`[e2e] LNURL callback: ${lnurlData.callback}`);

  // Step 2: Call callback with 100 sat (100000 msat) to get bolt11
  const callbackUrl = lnurlData.callback.replace("https://dev.coinos.io/api", apiBaseUrl);
  const callbackRes = await page.request.get(`${callbackUrl}?amount=100000`);
  const callbackData = await callbackRes.json();
  const bolt11 = callbackData.pr;
  expect(bolt11).toBeTruthy();
  console.log(`[e2e] Got bolt11: ${bolt11.substring(0, 40)}...`);

  // Step 3: Pay from external lightning node
  console.log("[e2e] Paying from external lightning node (clb)...");
  const payResult = lightningPay(bolt11);
  console.log(`[e2e] Lightning pay result: ${payResult.substring(0, 100)}`);

  // --- Bob: should be redirected to /paid ---
  await page.waitForURL(/\/invoice\/[^/]+\/paid/, { timeout: 30_000 });
  console.log(`[e2e] Bob redirected to: ${page.url()}`);

  // Verify success UI is shown
  const heading = await page.locator("h1").first().innerText({ timeout: 5_000 });
  expect(
    heading.toLowerCase().includes("payment") || heading.toLowerCase().includes("success"),
    `Expected payment success/detected text, got: ${heading}`,
  ).toBeTruthy();

  if (process.env.E2E_PAUSE_AT_END === "true") await page.pause();
});