CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
org-insights.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.
| 8f50ed0 | 1 | /** |
| 2 | * Block F2 — Org insights smoke tests. | |
| 3 | */ | |
| 4 | ||
| 5 | import { describe, it, expect } from "bun:test"; | |
| 6 | import app from "../app"; | |
| 7 | import { computeOrgInsights } from "../routes/org-insights"; | |
| 8 | ||
| 9 | describe("org-insights — route smoke", () => { | |
| 10 | it("GET /orgs/:slug/insights without auth → 302 /login", async () => { | |
| 11 | const res = await app.request("/orgs/nobody/insights"); | |
| 12 | expect(res.status).toBe(302); | |
| 13 | const loc = res.headers.get("location") || ""; | |
| 14 | expect(loc.startsWith("/login")).toBe(true); | |
| 15 | }); | |
| 16 | }); | |
| 17 | ||
| 18 | describe("org-insights — computeOrgInsights", () => { | |
| 19 | it("returns empty summary for unknown org id", async () => { | |
| 20 | const s = await computeOrgInsights( | |
| 21 | "00000000-0000-0000-0000-000000000000" | |
| 22 | ); | |
| 23 | expect(s.repoCount).toBe(0); | |
| 24 | expect(s.gateRunsTotal).toBe(0); | |
| 25 | expect(s.greenRate).toBe(0); | |
| 26 | expect(s.perRepo).toEqual([]); | |
| 27 | }); | |
| 28 | }); |