WebsiteBench / tasks /linkedin /solution /site /implementation /clone /tests /public-deployment.test.mjs
AgPerry's picture
Add files using upload-large-folder tool
9d4a3b0 verified
Raw History Blame Contribute Delete
1.52 kB
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import { join } from "node:path";
import test from "node:test";
const root = process.cwd();
test("WebsiteBench public deployment routes are wired without QQ SMTP or Stripe coupling", async () => {
const sendCode = await readFile(join(root, "app", "api", "auth", "send-code", "route.ts"), "utf8");
const verifyCode = await readFile(join(root, "app", "api", "auth", "verify-code", "route.ts"), "utf8");
const publicRegister = await readFile(join(root, "app", "public-register", "route.ts"), "utf8");
const dockerfile = await readFile(join(root, "Dockerfile.public"), "utf8");
const readme = await readFile(join(root, "deploy", "README-public-deployment.md"), "utf8");
assert.match(sendCode, /issuePublicRegistrationCode/);
assert.match(verifyCode, /verifyPublicRegistrationCode/);
assert.match(publicRegister, /consumePublicRegistrationTicket/);
assert.match(publicRegister, /headers:\s*\{\s*Location:\s*"\/feed"\s*\}/s);
assert.doesNotMatch(publicRegister, /NextResponse\.redirect\(new URL\("\/feed"/);
assert.doesNotMatch(sendCode + verifyCode + publicRegister, /nodemailer|SMTP|QQ|stripe/i);
assert.match(dockerfile, /PUBLIC_CLONE_AUTH_MODE=redis-resend/);
assert.match(dockerfile, /PUBLIC_CLONE_AUTH_REDIS_REST_URL=http:\/\/redis\.internal/);
assert.match(dockerfile, /PUBLIC_CLONE_AUTH_RESEND_API_URL=http:\/\/resend\.internal\/emails/);
assert.match(readme, /Stripe remains workflow-pending/);
});