CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
claude-web.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.
| 4d9e72b | 1 | /** |
| 2 | * Tests for src/routes/claude-web.tsx. | |
| 3 | * | |
| 4 | * We only verify the auth gate behaviour here — the Claude session logic | |
| 5 | * itself is covered by claude-web-session.test.ts. | |
| 6 | */ | |
| 7 | ||
| 8 | import { describe, it, expect } from "bun:test"; | |
| 9 | import app from "../app"; | |
| 10 | ||
| 11 | describe("claude-web route registration", () => { | |
| 12 | it("GET /:owner/:repo/claude redirects unauthenticated users to /login", async () => { | |
| 13 | // The route exists and enforces authentication — without a session | |
| 14 | // cookie the response must be a redirect to /login. | |
| 15 | const res = await app.request("/testowner/testrepo/claude", { | |
| 16 | redirect: "manual", | |
| 17 | }); | |
| 18 | expect(res.status).toBe(302); | |
| 19 | const location = res.headers.get("location") ?? ""; | |
| 20 | expect(location).toContain("/login"); | |
| 21 | }); | |
| 22 | ||
| 23 | it("GET /:owner/:repo/claude/:sessionId redirects unauthenticated users to /login", async () => { | |
| 24 | const res = await app.request( | |
| 25 | "/testowner/testrepo/claude/00000000-0000-0000-0000-000000000001", | |
| 26 | { redirect: "manual" } | |
| 27 | ); | |
| 28 | expect(res.status).toBe(302); | |
| 29 | const location = res.headers.get("location") ?? ""; | |
| 30 | expect(location).toContain("/login"); | |
| 31 | }); | |
| 32 | ||
| 33 | it("GET /:owner/:repo/claude/:sessionId/stream redirects unauthenticated users to /login", async () => { | |
| 34 | const res = await app.request( | |
| 35 | "/testowner/testrepo/claude/00000000-0000-0000-0000-000000000001/stream", | |
| 36 | { redirect: "manual" } | |
| 37 | ); | |
| 38 | expect(res.status).toBe(302); | |
| 39 | const location = res.headers.get("location") ?? ""; | |
| 40 | expect(location).toContain("/login"); | |
| 41 | }); | |
| 42 | }); |