(t *testing.T)
| 247 | } |
| 248 | |
| 249 | func TestModel_PromptConfirm(t *testing.T) { |
| 250 | m := newTestModel() |
| 251 | |
| 252 | // Show a prompt |
| 253 | m = m.showPrompt("Test?", "kill", "abc123def456") |
| 254 | if m.overlay != overlayPrompt { |
| 255 | t.Fatal("expected overlayPrompt") |
| 256 | } |
| 257 | |
| 258 | // Confirm — sends PromptResultMsg |
| 259 | result, cmd := m.Update(tea.KeyPressMsg{Code: 'y'}) |
| 260 | m = result.(model) |
| 261 | |
| 262 | if cmd == nil { |
| 263 | t.Fatal("expected cmd from prompt confirm") |
| 264 | } |
| 265 | |
| 266 | // Execute the cmd — should produce PromptResultMsg |
| 267 | msg := cmd() |
| 268 | if _, ok := msg.(appui.PromptResultMsg); !ok { |
| 269 | t.Fatalf("expected PromptResultMsg, got %T", msg) |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | func TestModel_PromptDeny(t *testing.T) { |
| 274 | m := newTestModel() |
nothing calls this directly
no test coverage detected