Skip to content

Commit 230c83f

Browse files
committed
Add a failing test for the settings overlay's fixture fallback
1 parent f73e1da commit 230c83f

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* CL-5596: a missing surface dependency must produce an honest empty state,
3+
* never the hardcoded rows from residuals.ts rendered as if they were real.
4+
*/
5+
import { describe, expect, test } from "bun:test"
6+
7+
import { openSettingsSurface, type CommandSurfaceDeps } from "./command-surfaces.js"
8+
import { withTestRenderer } from "./harness.js"
9+
import { createAppShell } from "./shell.js"
10+
11+
describe("overlay dependency gaps never render fixture content", () => {
12+
test("settings surface without a settings dependency shows no fabricated rows", async () => {
13+
await withTestRenderer(
14+
async (h) => {
15+
const shell = createAppShell(h.renderer, {
16+
terminal: { columns: 80, rows: 24 },
17+
run: "idle",
18+
})
19+
try {
20+
const notified: string[] = []
21+
const deps: CommandSurfaceDeps = { notify: (text) => notified.push(text) }
22+
23+
openSettingsSurface(shell, deps)
24+
25+
expect(shell.overlayItems).not.toContain(
26+
"Permissions — revoke remembered approvals",
27+
)
28+
expect(shell.overlayItems).not.toContain("Compaction — summarize vs drop")
29+
expect(notified.length).toBeGreaterThan(0)
30+
} finally {
31+
shell.dispose()
32+
}
33+
},
34+
{ width: 80, height: 24 },
35+
)
36+
})
37+
})

0 commit comments

Comments
 (0)