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

Function TestCtrlCPopoverClosesInsteadOfQuitting

internal/tui/tui_test.go:163–177  ·  view source on GitHub ↗

TestCtrlCPopoverClosesInsteadOfQuitting: with the popover open and no in-flight op, Ctrl+C dismisses the popover and does not arm quit.

(t *testing.T)

Source from the content-addressed store, hash-verified

161// TestCtrlCPopoverClosesInsteadOfQuitting: with the popover open and no
162// in-flight op, Ctrl+C dismisses the popover and does not arm quit.
163func TestCtrlCPopoverClosesInsteadOfQuitting(t *testing.T) {
164 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
165 mm := typeInto(m, "/")
166 if !mm.popoverOpen() {
167 t.Fatal("precondition: popover should be open")
168 }
169 out, _ := mm.Update(tea.KeyMsg{Type: tea.KeyCtrlC})
170 om := out.(Model)
171 if om.popoverOpen() {
172 t.Fatal("Ctrl+C should close popover")
173 }
174 if !om.quitArmedAt.IsZero() {
175 t.Fatal("popover-close should not arm quit")
176 }
177}
178
179// TestCtrlCCancelsInflightOp: with a turn in flight, Ctrl+C cancels, clears
180// pending tool calls, and leaves a "✗ cancelled" line in scrollback.

Callers

nothing calls this directly

Calls 4

newTestModelFunction · 0.85
typeIntoFunction · 0.85
popoverOpenMethod · 0.80
UpdateMethod · 0.45

Tested by

no test coverage detected