import { describe, it, expect } from "bun:test";
import app from "../app";
describe("vs-github — public marketing page", () => {
it("GET /vs-github returns 200 HTML to an anonymous visitor", async () => {
const res = await app.request("/vs-github");
expect(res.status).toBe(200);
const ct = res.headers.get("content-type") || "";
expect(ct.toLowerCase()).toContain("text/html");
});
it("mentions both GitHub and Gluecron (sanity)", async () => {
const res = await app.request("/vs-github");
const body = await res.text();
expect(body).toContain("GitHub");
expect(body.toLowerCase()).toContain("gluecron");
});
it("renders the AI-native workflow rows from category 1", async () => {
const res = await app.request("/vs-github");
const body = await res.text();
expect(body).toContain("AI-native workflow");
expect(body).toContain("AI code review on every PR");
expect(body).toContain("AI auto-merge when checks pass");
expect(body).toContain("Spec → PR pipeline");
expect(body).toContain("Label-an-issue");
expect(body).toContain("AI explain-this-codebase");
expect(body).toContain("AI changelog per commit range");
expect(body).toContain("AI incident responder");
expect(body).toContain("AI dependency updater");
expect(body).toContain("AI security scan on every push");
expect(body).toContain("AI Sleep Mode");
});
it("CTA points at /import", async () => {
const res = await app.request("/vs-github");
const body = await res.text();
expect(body).toContain('href="/import"');
expect(body).toContain('href="/sleep-mode"');
});
it("does not require authentication (no redirect)", async () => {
const res = await app.request("/vs-github");
expect(res.status).toBe(200);
expect(res.status).not.toBe(302);
expect(res.status).not.toBe(401);
expect(res.status).not.toBe(403);
});
it("does NOT clobber the existing /:owner/:repo/compare branch-diff route", async () => {
const res = await app.request("/some-owner/some-repo/compare/main...feature");
const body = await res.text();
expect(body).not.toContain("The git host built around Claude.");
});
});
|