Add MVP operational readiness checks

This commit is contained in:
2026-06-05 21:46:16 +02:00
parent df8ca1f049
commit d3928d61c4
7 changed files with 341 additions and 7 deletions

View File

@@ -0,0 +1,38 @@
import assert from "node:assert/strict";
import test from "node:test";
import {
getIntegrationReadiness,
integrationReadinessDefinitions,
} from "../lib/operational-readiness";
test("integration readiness covers all MVP providers", () => {
assert.deepEqual(
integrationReadinessDefinitions.map((definition) => definition.id),
[
"google",
"pagespeed",
"openrouter",
"playwright",
"smtp",
"convex_jobs",
"rybbit",
],
);
});
test("integration readiness reports missing configuration without leaking values", () => {
const rows = getIntegrationReadiness({
GOOGLE_GEOCODING_API_KEY: "secret-google",
GOOGLE_PLACES_API_KEY: "secret-places",
PAGESPEED_API_KEY: "",
});
const google = rows.find((row) => row.id === "google");
const pageSpeed = rows.find((row) => row.id === "pagespeed");
assert.equal(google?.status, "configured");
assert.equal(pageSpeed?.status, "missing");
assert.equal(JSON.stringify(rows).includes("secret-google"), false);
assert.equal(JSON.stringify(rows).includes("secret-places"), false);
});

View File

@@ -0,0 +1,61 @@
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",
"Playwright",
"SMTP",
"Convex Jobs",
"Rybbit",
"Konfiguration fehlt",
]) {
assert.match(`${componentSource}\n${helperSource}`, new RegExp(label));
}
});
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/);
});