diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-07 11:26:10 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-07 11:26:10 +0300 |
| commit | 8889949ad3851bfbf36ff5b73128286d67c88201 (patch) | |
| tree | 0f515ae6ee3da898dea113799c09e943f3e3f8fb /internal/hexaiaction | |
| parent | 7c0266e94378f6121719939c6d53915eb72eed3e (diff) | |
tiding up
Diffstat (limited to 'internal/hexaiaction')
| -rw-r--r-- | internal/hexaiaction/tui_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/hexaiaction/tui_test.go b/internal/hexaiaction/tui_test.go index 0f7d091..6f1debc 100644 --- a/internal/hexaiaction/tui_test.go +++ b/internal/hexaiaction/tui_test.go @@ -34,3 +34,24 @@ func TestHandleKey_JumpEndWithG(t *testing.T) { } } +func TestItemMethods(t *testing.T) { + it := item{title: "T", desc: "D", kind: ActionRewrite, hotkey: 'r'} + if it.Title() != "T" || it.Description() != "D" || it.FilterValue() != "T" { + t.Fatalf("item methods wrong: %+v", it) + } +} + +func TestModelInitAndViewAndUpdate(t *testing.T) { + m := newModel() + if m.Init() != nil { + t.Fatalf("Init should return nil cmd") + } + if v := m.View(); v == "" { + t.Fatalf("View should not be empty before done") + } + // Window resize + nm, _ := m.Update(tea.WindowSizeMsg{Width: 80, Height: 24}) + if _, ok := nm.(model); !ok { + t.Fatalf("expected model after WindowSizeMsg") + } +} |
