summaryrefslogtreecommitdiff
path: root/internal/tui/dashboard/model_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-26 23:47:16 +0200
committerPaul Buetow <paul@buetow.org>2026-02-26 23:47:16 +0200
commit34e70c9cd76b0231cfff3910bb24708624d7c72d (patch)
treed17c70b4b1f467ba72fe238d9b1656c1dde564a2 /internal/tui/dashboard/model_test.go
parentdcdfbcc0a2ee9750e48a8db74b4ca70fdac2f9c6 (diff)
tui: clarify export help and toggle help bar with uppercase H
Diffstat (limited to 'internal/tui/dashboard/model_test.go')
-rw-r--r--internal/tui/dashboard/model_test.go31
1 files changed, 28 insertions, 3 deletions
diff --git a/internal/tui/dashboard/model_test.go b/internal/tui/dashboard/model_test.go
index 37dbe28..931fcff 100644
--- a/internal/tui/dashboard/model_test.go
+++ b/internal/tui/dashboard/model_test.go
@@ -369,8 +369,11 @@ func TestViewRendersTabBarAndHelp(t *testing.T) {
if !strings.Contains(out, "Overview") {
t.Fatalf("expected overview label in view")
}
- if !strings.Contains(out, "tab next tab") {
- t.Fatalf("expected help bar text in view")
+ if !strings.Contains(out, "press H for help") {
+ t.Fatalf("expected help hint text in view")
+ }
+ if strings.Contains(out, "tab next tab") {
+ t.Fatalf("did not expect expanded help bar by default")
}
}
@@ -405,7 +408,29 @@ func TestStreamTabViewKeepsTabAndHelpChromeVisible(t *testing.T) {
if !strings.Contains(out, "1:Overview") {
t.Fatalf("expected tab bar to remain visible in stream view")
}
+ if !strings.Contains(out, "press H for help") {
+ t.Fatalf("expected help hint to remain visible in stream view")
+ }
+}
+
+func TestHelpToggleWithH(t *testing.T) {
+ m := NewModelWithConfig(nil, nil, 1000, common.DefaultKeyMap())
+ out := m.View()
+ if !strings.Contains(out, "press H for help") {
+ t.Fatalf("expected default help hint")
+ }
+
+ next, _ := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'H'}})
+ m = next.(Model)
+ out = m.View()
if !strings.Contains(out, "tab next tab") {
- t.Fatalf("expected help bar to remain visible in stream view")
+ t.Fatalf("expected expanded help after pressing h")
+ }
+
+ next, _ = m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'H'}})
+ m = next.(Model)
+ out = m.View()
+ if !strings.Contains(out, "press H for help") {
+ t.Fatalf("expected help hint after pressing h again")
}
}