TestPopoverEnterSubmitsNoArgCommand: Enter at command-level on a command without args still submits immediately (/clear).
(t *testing.T)
| 437 | // TestPopoverEnterSubmitsNoArgCommand: Enter at command-level on a command |
| 438 | // without args still submits immediately (/clear). |
| 439 | func 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. |
nothing calls this directly
no test coverage detected