MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestPopoverEnterSubmitsNoArgCommand

Function TestPopoverEnterSubmitsNoArgCommand

internal/tui/tui_test.go:439–457  ·  view source on GitHub ↗

TestPopoverEnterSubmitsNoArgCommand: Enter at command-level on a command without args still submits immediately (/clear).

(t *testing.T)

Source from the content-addressed store, hash-verified

437// TestPopoverEnterSubmitsNoArgCommand: Enter at command-level on a command
438// without args still submits immediately (/clear).
439func TestPopoverEnterSubmitsNoArgCommand(t *testing.T) {
440 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
441 mm := typeInto(m, "/cl") // /clear matches, no args
442 if !mm.popoverOpen() {
443 t.Fatal("popover should be open")
444 }
445 out, _ := mm.Update(tea.KeyMsg{Type: tea.KeyEnter})
446 om := out.(Model)
447 if om.popoverOpen() {
448 t.Fatal("popover should close after submit")
449 }
450 if om.ta.Value() != "" {
451 t.Fatalf("textarea should reset: %q", om.ta.Value())
452 }
453 // /clear fires a "✓ conversation reset" line into scrollback
454 if !strings.Contains(om.scroll.String(), "conversation reset") {
455 t.Fatalf("/clear should have executed: %s", om.scroll.String())
456 }
457}
458
459// TestArgPopoverOpensForModels: "/models " shows the profile names (no synthetic
460// "next", Tab cycles instead) with the active profile preselected.

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected