MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestPopoverSelectionStaysVisible

Function TestPopoverSelectionStaysVisible

internal/tui/tui_test.go:2785–2796  ·  view source on GitHub ↗

TestPopoverSelectionStaysVisible: with more than popoverCap suggestions the popover renders a window; when the selection moves past it, renderPopover must scroll so the highlighted row stays shown, else Enter commits an unseen row.

(t *testing.T)

Source from the content-addressed store, hash-verified

2783 m.installTurnContext()
2784 m.phase = phaseStreaming
2785 m.pending = []chmctx.ToolCall{
2786 {ID: "stale-c1", Name: "bash", Arguments: map[string]any{"cmd": "echo stale"}},
2787 }
2788 m.endTurn()
2789 if len(m.pending) != 0 {
2790 t.Fatalf("endTurn must drop pending tool calls, got %d leftover", len(m.pending))
2791 }
2792}
2793
2794// TestStaleProbeDoesNotPrintActivationBannerForNonActiveProfile: a probe for a
2795// profile the user has /models'd away from must not print "✓ active: <profile>":
2796// the banner would be a lie. Pairs with the connection state guard in
2797// TestStaleProbeForOldProfileDoesNotOverwriteConnectedFlag.
2798func TestStaleProbeDoesNotPrintActivationBannerForNonActiveProfile(t *testing.T) {
2799 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})

Callers

nothing calls this directly

Calls 2

renderPopoverMethod · 0.95
stripANSIFunction · 0.85

Tested by

no test coverage detected