Files
webdev-pipeline/tests/ops-quality-source.test.ts

71 lines
2.2 KiB
TypeScript

import assert from "node:assert/strict";
import { existsSync, readFileSync } from "node:fs";
import { join } from "node:path";
import test from "node:test";
function source(path: string) {
return readFileSync(join(process.cwd(), ...path.split("/")), "utf8");
}
test("settings page surfaces integration status instead of a placeholder", () => {
const pageSource = source("app/dashboard/settings/page.tsx");
const componentSource = source("components/settings/operations-readiness.tsx");
const helperSource = source("lib/operational-readiness.ts");
assert.doesNotMatch(pageSource, /DashboardPlaceholderPage/);
assert.match(pageSource, /OperationsReadiness/);
for (const label of [
"Google",
"PageSpeed",
"OpenRouter",
"ScreenshotOne",
"SMTP",
"Convex Jobs",
"Rybbit",
"Jina",
"Konfiguration fehlt",
]) {
assert.match(`${componentSource}\n${helperSource}`, new RegExp(label));
}
assert.doesNotMatch(helperSource, /id: "playwright"/);
assert.doesNotMatch(helperSource, /requiredEnv: \["TASK8_BROWSER_ASSET_URL"\]/);
assert.match(helperSource, /requiredEnv: \["SCREENSHOTONE_API_KEY"\]/);
assert.match(helperSource, /requiredEnv: \[\]/);
assert.match(componentSource, /Next\.js-Runtime/);
assert.match(componentSource, /Convex-Action-Env/);
assert.match(helperSource, /Convex-Run-Events/);
});
test("verification notes cover critical MVP flows", () => {
const docPath = join(process.cwd(), "docs", "verification.md");
assert.equal(existsSync(docPath), true);
const doc = readFileSync(docPath, "utf8");
for (const label of [
"Login",
"Kampagnenlauf",
"Audit-Generierung",
"Freigabe",
"Versand",
"Follow-up",
"Analytics",
]) {
assert.match(doc, new RegExp(label));
}
});
test("Coolify deployment notes cover env vars, Playwright dependencies, port, and domains", () => {
const docPath = join(process.cwd(), "docs", "coolify-deployment.md");
assert.equal(existsSync(docPath), true);
const doc = readFileSync(docPath, "utf8");
assert.match(doc, /Environment Variables/);
assert.match(doc, /TASK8_BROWSER_ASSET_URL/);
assert.match(doc, /Playwright/);
assert.match(doc, /Port 3000/);
assert.match(doc, /NEXT_PUBLIC_APP_URL/);
assert.match(doc, /Domain/);
});