aboutsummaryrefslogtreecommitdiffstats
path: root/test-ark-create.mjs
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-11 17:51:24 -0800
committerAdam Soltys <[email protected]>2026-02-11 17:51:24 -0800
commit13466248004327e9a026cb89f94926f9b060d1c1 (patch)
tree47b4972c33809ccdf866b043c92cd3e0ecf5dcd0 /test-ark-create.mjs
parent3aa9ce1b5985397d7f568887ec6f881df13c1034 (diff)
downloadcoinos-ui-13466248004327e9a026cb89f94926f9b060d1c1.tar.gz
coinos-ui-13466248004327e9a026cb89f94926f9b060d1c1.zip
linting
Diffstat (limited to 'test-ark-create.mjs')
-rw-r--r--test-ark-create.mjs29
1 files changed, 23 insertions, 6 deletions
diff --git a/test-ark-create.mjs b/test-ark-create.mjs
index 7db6c79b..7fc9b24e 100644
--- a/test-ark-create.mjs
+++ b/test-ark-create.mjs
@@ -9,19 +9,28 @@ const API_KEY = "test-playwright-key";
const context = await browser.newContext({ ignoreHTTPSErrors: true });
const page = await context.newPage();
- page.on("console", (msg) => console.log(`[browser:${msg.type()}]`, msg.text()));
+ page.on("console", (msg) =>
+ console.log(`[browser:${msg.type()}]`, msg.text()),
+ );
page.on("pageerror", (err) => console.log("[page error]", err.message));
page.on("request", (req) => {
const u = req.url();
if (u.includes("account") || u.includes("arkade.computer")) {
- console.log(`[req] ${req.method()} ${u} ${req.postData()?.substring(0, 500) || ""}`);
+ console.log(
+ `[req] ${req.method()} ${u} ${req.postData()?.substring(0, 500) || ""}`,
+ );
}
});
page.on("response", (resp) => {
const u = resp.url();
if (u.includes("account") && !u.includes("__data")) {
- resp.text().then((t) => console.log(`[resp] ${resp.status()} ${u} -> ${t.substring(0, 500)}`)).catch(() => {});
+ resp
+ .text()
+ .then((t) =>
+ console.log(`[resp] ${resp.status()} ${u} -> ${t.substring(0, 500)}`),
+ )
+ .catch(() => {});
}
});
@@ -35,7 +44,10 @@ const API_KEY = "test-playwright-key";
for (const h of await loginResp.headersArray()) {
if (h.name.toLowerCase() === "set-cookie") {
const m = h.value.match(/token=([^;]+)/);
- if (m) await context.addCookies([{ name: "token", value: m[1], domain: "172.18.0.9", path: "/" }]);
+ if (m)
+ await context.addCookies([
+ { name: "token", value: m[1], domain: "172.18.0.9", path: "/" },
+ ]);
}
}
@@ -54,7 +66,10 @@ const API_KEY = "test-playwright-key";
if (await revealBtn.count()) {
await revealBtn.click();
await page.waitForTimeout(1000);
- const nsecText = await page.locator("button[aria-label='Copy backup key']").innerText().catch(() => "not found");
+ const nsecText = await page
+ .locator("button[aria-label='Copy backup key']")
+ .innerText()
+ .catch(() => "not found");
console.log("Backup key:", nsecText.substring(0, 30), "...");
}
@@ -91,7 +106,9 @@ const API_KEY = "test-playwright-key";
console.log("\n--- Checking accounts ---");
const acctResp = await page.request.get(`${API}/accounts`, {
headers: {
- cookie: (await context.cookies()).map((c) => `${c.name}=${c.value}`).join("; "),
+ cookie: (await context.cookies())
+ .map((c) => `${c.name}=${c.value}`)
+ .join("; "),
},
});
const accounts = await acctResp.json();