Files
canvas-frontend/qa/probe_csp.mjs
T
shad e52c4a7d53 fix(chat): render time badge for every thread row (no missing per-thread time)
The strict QA gate requires timeBadges === threadRowCount. When a
thread has no preview message (e.g. legacy thread the inbox edge fetch
failed for), the time span used to be omitted entirely. Now renders
'—' for missing preview so the per-row time element exists.
2026-06-14 15:47:28 +04:00

21 lines
1.1 KiB
JavaScript

import { chromium } from "playwright";
const args = ["--host-resolver-rules=MAP canvas.flow-master.ai 65.21.71.186", "--ignore-certificate-errors"];
const b = await chromium.launch({ headless: true, args });
const p = await (await b.newContext()).newPage();
const cspViolations = [];
const consoleErrors = [];
p.on("console", (msg) => {
if (msg.type() === "error") consoleErrors.push(msg.text());
if (msg.text().includes("Content Security Policy")) cspViolations.push(msg.text());
});
p.on("pageerror", (err) => consoleErrors.push(`PAGE ERROR: ${err.message}`));
await p.goto("https://canvas.flow-master.ai/", { waitUntil: "networkidle" });
await p.waitForTimeout(2000);
const loginVisible = await p.locator(".login-page").count();
console.log(`login page visible: ${loginVisible === 1 ? "YES" : "NO"}`);
console.log(`csp violations: ${cspViolations.length}`);
cspViolations.forEach((v) => console.log(" -", v.slice(0, 150)));
console.log(`console errors: ${consoleErrors.length}`);
consoleErrors.slice(0, 5).forEach((e) => console.log(" -", e.slice(0, 150)));
await b.close();