Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history

status-seo.test.ts

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

status-seo.test.tsBlame60 lines · 1 contributor
9b07ca9Claude1/**
2 * Smoke tests for the public /status page, /status.svg badge, and SEO
3 * routes (/robots.txt + /sitemap.xml). These don't stub the DB — they
4 * tolerate either success (dev DB reachable) or a graceful error page
5 * so they work in the sandbox environment.
6 */
7
8import { test, expect } from "bun:test";
9import app from "../app";
10
11test("/status returns 200 with HTML body", async () => {
12 const res = await app.request("/status");
13 expect(res.status).toBe(200);
14 const body = await res.text();
15 expect(body).toContain("<html");
16 // Either the green or red headline should appear
17 expect(
18 body.includes("All systems operational") ||
74a8784Claude19 body.includes("Degraded performance") ||
20 body.includes("Major outage")
9b07ca9Claude21 ).toBe(true);
22});
23
24test("/status.svg returns an SVG badge", async () => {
25 const res = await app.request("/status.svg");
26 expect(res.status).toBe(200);
27 expect(res.headers.get("content-type")).toMatch(/image\/svg/);
28 const body = await res.text();
29 expect(body).toContain("<svg");
30 expect(body).toContain("</svg>");
31});
32
33test("/robots.txt returns 200 with crawler directives", async () => {
34 const res = await app.request("/robots.txt");
35 expect(res.status).toBe(200);
36 expect(res.headers.get("content-type")).toMatch(/text\/plain/);
37 const body = await res.text();
38 expect(body).toContain("User-agent:");
39 expect(body).toContain("Sitemap:");
40 expect(body).toContain("Disallow: /admin");
41});
42
43test("/sitemap.xml returns valid-looking XML", async () => {
44 const res = await app.request("/sitemap.xml");
45 expect(res.status).toBe(200);
46 expect(res.headers.get("content-type")).toMatch(/xml/);
47 const body = await res.text();
48 expect(body).toContain('<?xml');
49 expect(body).toContain("<urlset");
50 expect(body).toContain("<loc>");
51 expect(body).toContain("</urlset>");
52});
53
54test("sitemap includes the landing, status, explore URLs", async () => {
55 const res = await app.request("/sitemap.xml");
56 const body = await res.text();
57 expect(body).toMatch(/<loc>[^<]*\/<\/loc>/);
58 expect(body).toContain("/status");
59 expect(body).toContain("/explore");
60});