TestPopoverArrowKeysMoveSelection: while popover is open, ↑/↓ move the selection (NOT arrow history), and the textarea is not clobbered.
(t *testing.T)
| 395 | // TestPopoverArrowKeysMoveSelection: while popover is open, ↑/↓ move the |
| 396 | // selection (NOT arrow history), and the textarea is not clobbered. |
| 397 | func TestPopoverArrowKeysMoveSelection(t *testing.T) { |
| 398 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 399 | m.promptHistory = []promptEntry{{display: "old prompt"}} // should NOT be recalled while popover open |
| 400 | mm := typeInto(m, "/") |
| 401 | start := mm.suggestIdx |
| 402 | n := len(mm.suggest) |
| 403 | mm2, _ := mm.Update(tea.KeyMsg{Type: tea.KeyDown}) |
| 404 | if mm2.(Model).suggestIdx != (start+1)%n { |
| 405 | t.Fatalf("↓ should move selection, got idx=%d (was %d)", |
| 406 | mm2.(Model).suggestIdx, start) |
| 407 | } |
| 408 | if got := mm2.(Model).ta.Value(); got != "/" { |
| 409 | t.Fatalf("textarea must not be overwritten by history while popover open: %q", got) |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | // TestPopoverEnterAdvancesIntoArgsForArgsCommand: Enter at command-level on a |
| 414 | // command that takes args does NOT submit: it opens the arg-level popover, |
nothing calls this directly
no test coverage detected