--- Thread state ---
(t *testing.T)
| 148 | t.Fatalf("search empty state = %q", got) |
| 149 | } |
| 150 | if cmd := v.HandleContentKey(keyPress("c")); cmd == nil || v.query != "" { |
| 151 | t.Fatalf("clear search = cmd:%v query:%q", cmd != nil, v.query) |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | func TestJournalSearchEscapeKeepsFeed(t *testing.T) { |
| 156 | v := loadedJournalView(journalEntries(1)) |
| 157 | v.HandleContentKey(keyPress("/")) |
| 158 | v.prompt.input.SetValue("discard me") |
| 159 | v.HandleContentKey(keyPress("esc")) |
| 160 | if v.prompt != nil || v.query != "" || len(v.list.entries) != 1 { |
| 161 | t.Fatalf("cancelled search = prompt:%v query:%q entries:%d", v.prompt != nil, v.query, len(v.list.entries)) |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | func TestJournalDateJumpValidatesAndLoads(t *testing.T) { |
| 166 | v := loadedJournalView(nil) |
| 167 | v.HandleContentKey(keyPress("g")) |
nothing calls this directly
no test coverage detected