Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tui/escape-import-tab.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ describe("Esc on the Import tab", () => {
bus.emit({ type: "ui_mode_set", mode: "debug" });
bus.emit({ type: "tab_changed", tab: "import" });
await settle();
expect(strip(lastFrame() ?? "")).toContain("Manage");
expect(strip(lastFrame() ?? "")).toContain("Manage");

stdin.write(ESC);
await settle();

// The configure-mode handler ends in a catch-all `return true` that
// swallows stray letters; before the fix it swallowed Esc too, so the
// operator was stuck on the tab with no "back" gesture at all.
expect(strip(lastFrame() ?? "")).toContain("Run");
expect(strip(lastFrame() ?? "")).toContain("Run");
expect(quit).toBe(0);
unmount();
});
Expand Down
4 changes: 2 additions & 2 deletions src/tui/escape-observe-tabs.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe("Esc on the Observe tabs", () => {
bus.emit({ type: "ui_mode_set", mode: "debug" });
bus.emit({ type: "tab_changed", tab });
await settle();
expect(strip(lastFrame() ?? "")).toContain("Observe");
expect(strip(lastFrame() ?? "")).toContain("Observe");

stdin.write(ESC);
await settle();
Expand All @@ -67,7 +67,7 @@ describe("Esc on the Observe tabs", () => {
// reached the still-focused chat editor and quit the process.
expect(counts.quit).toBe(0);
expect(counts.abort).toBe(0);
expect(strip(lastFrame() ?? "")).toContain("Run");
expect(strip(lastFrame() ?? "")).toContain("Run");
unmount();
});
}
Expand Down
26 changes: 16 additions & 10 deletions src/tui/tui-app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ describe("TuiApp (smoke)", () => {
expect(text).toContain("Run");
expect(text).not.toContain("Observe");
expect(text).not.toContain("Manage");
// The splash mark scales with the window; ink-testing-library's
// 100-column stdout reports no rows, so the fallback 80x24 surface
// gets the compact mark rather than the wordmark + tagline. Assert
// on what every size keeps. See `components/splash-fit.render.test.tsx`.
expect(text).toContain(":::");
// The splash mark scales with the window and is drawn as a block
// raster, so its exact glyphs vary by size. Assert the rail the Run
// screen always carries instead. See `components/splash-fit.render.test.tsx`.
expect(text).toContain("Sessions");
expect(text).toContain("commands");
unmount();
});
Expand Down Expand Up @@ -210,9 +209,13 @@ describe("TuiApp (smoke)", () => {
stdin.write("\u001b[Z");
await new Promise((r) => setTimeout(r, 10));
const text = strip(lastFrame() ?? "");
// Shift+Tab from Run wraps to the last Manage sub-tab (Telegram).
// Shift+Tab from Run wraps to the LAST Manage sub-tab. That is
// `privacy`, not `telegram` — see `MANAGE_TABS` in `section.ts`, which
// gained `import` and `privacy` after this test was written.
expect(text).toContain("Manage \u25b8");
expect(text).toContain("▸ Telegram");
// `▸` marks the ACTIVE sub-tab. A bare "Privacy" would also match the
// inactive chip in the strip, so it must carry the marker.
expect(text).toContain("▸ Privacy");
unmount();
});

Expand Down Expand Up @@ -308,11 +311,14 @@ describe("TuiApp (smoke)", () => {
bus.emit({ type: "tab_changed", tab: "llm" });
await new Promise((r) => setTimeout(r, 10));
const text = strip(lastFrame() ?? "");
expect(text).toContain("Active chat route");
expect(text).toContain("Mode:");
// ink-testing-library reports no rows, so the panel falls back to the
// 80x24 surface and picks its COMPACT header — `RouteCard` ("Active
// chat route") is dropped on purpose at that budget. The full/compact
// decision is covered directly in `components/llm-panel.test.tsx`,
// which drives `maxRows`; here we assert the two-mode body that every
// budget keeps.
expect(text).toContain("Local text models");
expect(text).toContain("Local embeddings");
expect(text).toContain("Press ←/→ to switch mode");
expect(text).not.toContain("Local runtime");
unmount();
});
Expand Down