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

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