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.tsBlame59 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") ||
19 body.includes("Service degraded")
20 ).toBe(true);
21});
22
23test("/status.svg returns an SVG badge", async () => {
24 const res = await app.request("/status.svg");
25 expect(res.status).toBe(200);
26 expect(res.headers.get("content-type")).toMatch(/image\/svg/);
27 const body = await res.text();
28 expect(body).toContain("<svg");
29 expect(body).toContain("</svg>");
30});
31
32test("/robots.txt returns 200 with crawler directives", async () => {
33 const res = await app.request("/robots.txt");
34 expect(res.status).toBe(200);
35 expect(res.headers.get("content-type")).toMatch(/text\/plain/);
36 const body = await res.text();
37 expect(body).toContain("User-agent:");
38 expect(body).toContain("Sitemap:");
39 expect(body).toContain("Disallow: /admin");
40});
41
42test("/sitemap.xml returns valid-looking XML", async () => {
43 const res = await app.request("/sitemap.xml");
44 expect(res.status).toBe(200);
45 expect(res.headers.get("content-type")).toMatch(/xml/);
46 const body = await res.text();
47 expect(body).toContain('<?xml');
48 expect(body).toContain("<urlset");
49 expect(body).toContain("<loc>");
50 expect(body).toContain("</urlset>");
51});
52
53test("sitemap includes the landing, status, explore URLs", async () => {
54 const res = await app.request("/sitemap.xml");
55 const body = await res.text();
56 expect(body).toMatch(/<loc>[^<]*\/<\/loc>/);
57 expect(body).toContain("/status");
58 expect(body).toContain("/explore");
59});