TestEscFromCommandLevelClosesAndClears: Esc at command-level closes the popover AND clears the textarea, so the user returns to a blank prompt. Typing "/" from the blank slate re-opens the popover from scratch.
(t *testing.T)
| 375 | // popover AND clears the textarea, so the user returns to a blank prompt. |
| 376 | // Typing "/" from the blank slate re-opens the popover from scratch. |
| 377 | func TestEscFromCommandLevelClosesAndClears(t *testing.T) { |
| 378 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 379 | mm := typeInto(m, "/") |
| 380 | mm2, _ := mm.Update(tea.KeyMsg{Type: tea.KeyEsc}) |
| 381 | om := mm2.(Model) |
| 382 | if om.popoverOpen() { |
| 383 | t.Fatal("Esc should close popover") |
| 384 | } |
| 385 | if om.ta.Value() != "" { |
| 386 | t.Fatalf("Esc at command-level should clear textarea, got %q", om.ta.Value()) |
| 387 | } |
| 388 | // Typing "/" from a blank slate re-opens the popover. |
| 389 | mm3 := typeInto(om, "/") |
| 390 | if !mm3.popoverOpen() { |
| 391 | t.Fatal("typing '/' after Esc should re-open popover") |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | // TestPopoverArrowKeysMoveSelection: while popover is open, ↑/↓ move the |
| 396 | // selection (NOT arrow history), and the textarea is not clobbered. |
nothing calls this directly
no test coverage detected