From 8889949ad3851bfbf36ff5b73128286d67c88201 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 7 Sep 2025 11:26:10 +0300 Subject: tiding up --- internal/hexaiaction/tui_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'internal/hexaiaction') 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") + } +} -- cgit v1.2.3