import { describe, it, expect } from "bun:test";
import app from "../app";
const HOME = "/";
describe("Block L10 — landing hero rewrite", () => {
it("GET / returns 200 HTML to an anonymous visitor", async () => {
const res = await app.request(HOME);
expect(res.status).toBe(200);
const ct = res.headers.get("content-type") || "";
expect(ct.toLowerCase()).toContain("text/html");
});
it("renders the new hero headline", async () => {
const res = await app.request(HOME);
const body = await res.text();
expect(body).toContain("The git host built around Claude.");
});
it("renders the install snippet", async () => {
const res = await app.request(HOME);
const body = await res.text();
expect(body).toContain("gluecron.com/install");
expect(body).toContain("curl -sSL gluecron.com/install | bash");
});
it("renders all three primary CTAs in the hero row", async () => {
const res = await app.request(HOME);
const body = await res.text();
expect(body).toContain('href="/register"');
expect(body).toContain('href="/demo"');
expect(body).toContain('href="/vs-github"');
expect(body).toContain("Sign up free");
expect(body).toContain("Try the live demo");
expect(body).toContain("Compare to GitHub");
});
it("renders the three reasons-to-switch column headings", async () => {
const res = await app.request(HOME);
const body = await res.text();
expect(body).toContain("Toggle Sleep Mode");
expect(body).toContain("One command to migrate");
expect(body).toContain("Open the demo, watch it work");
expect(body).toContain('href="/import"');
expect(body).toContain('href="/sleep-mode"');
expect(body).toContain('href="/demo"');
});
it("renders the 'How is this different' pull-quote", async () => {
const res = await app.request(HOME);
const body = await res.text();
expect(body).toContain("How is this different from GitHub?");
expect(body).toContain("Every other host bolts AI on as a sidecar.");
expect(body).toContain("first-class developer");
expect(body).toContain("Built to be");
expect(body).toContain("operated by AI agents");
expect(body).toContain("See the full comparison");
});
it("injects SEO + Open Graph meta tags", async () => {
const res = await app.request(HOME);
const body = await res.text();
expect(body).toContain(
"<title>Gluecron — The git host built around Claude</title>"
);
expect(body).toMatch(
/<meta\s+name="description"\s+content="Label an issue\. Walk away\. Wake up to a merged PR\./
);
expect(body).toMatch(
/<meta\s+property="og:title"\s+content="Gluecron — The git host built around Claude"/
);
expect(body).toMatch(
/<meta\s+property="og:description"\s+content="Label an issue\./
);
expect(body).toMatch(
/<meta\s+property="og:type"\s+content="website"/
);
expect(body).toMatch(
/<meta\s+name="twitter:card"\s+content="summary_large_image"/
);
});
it("REGRESSION: L4 counters tile section is still rendered", async () => {
const res = await app.request(HOME);
const body = await res.text();
const { buildSocialProofTiles } = await import("../views/landing");
expect(typeof buildSocialProofTiles).toBe("function");
if (body.includes("landing-counters-grid")) {
expect(body).toContain("data-counter-target");
}
});
it("REGRESSION: L5 'Compare to GitHub' CTA still routes to /vs-github", async () => {
const res = await app.request(HOME);
const body = await res.text();
expect(body).toContain('href="/vs-github"');
expect(body).toContain("Compare to GitHub");
});
});
|