summaryrefslogtreecommitdiff
path: root/internal/tui/dashboard/model_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-24 17:16:17 +0200
committerPaul Buetow <paul@buetow.org>2026-02-24 17:16:17 +0200
commit2ae0b33c9f196634eaa55bd6997d1feae9147385 (patch)
treeea4e0e705c693e44f29924014431186af635b7e5 /internal/tui/dashboard/model_test.go
parent92114c3b6bfe8a3d28487fcfb34fd291c573500c (diff)
tui: improve dashboard tab navigation and live updates
Diffstat (limited to 'internal/tui/dashboard/model_test.go')
-rw-r--r--internal/tui/dashboard/model_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/internal/tui/dashboard/model_test.go b/internal/tui/dashboard/model_test.go
index f1e6f35..7e4d9b4 100644
--- a/internal/tui/dashboard/model_test.go
+++ b/internal/tui/dashboard/model_test.go
@@ -43,6 +43,34 @@ func TestKeySwitchingChangesActiveTab(t *testing.T) {
}
}
+func TestArrowAndViKeysCycleTabs(t *testing.T) {
+ m := NewModelWithConfig(nil, 250, common.DefaultKeyMap())
+
+ next, _ := m.Update(tea.KeyMsg{Type: tea.KeyRight})
+ model := next.(Model)
+ if model.activeTab != TabSyscalls {
+ t.Fatalf("expected right arrow to move to syscalls, got %v", model.activeTab)
+ }
+
+ next, _ = model.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'l'}})
+ model = next.(Model)
+ if model.activeTab != TabFiles {
+ t.Fatalf("expected l to move to files, got %v", model.activeTab)
+ }
+
+ next, _ = model.Update(tea.KeyMsg{Type: tea.KeyLeft})
+ model = next.(Model)
+ if model.activeTab != TabSyscalls {
+ t.Fatalf("expected left arrow to move back to syscalls, got %v", model.activeTab)
+ }
+
+ next, _ = model.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'h'}})
+ model = next.(Model)
+ if model.activeTab != TabOverview {
+ t.Fatalf("expected h to move back to overview, got %v", model.activeTab)
+ }
+}
+
func TestSyscallsTabScrollsWithJK(t *testing.T) {
m := NewModelWithConfig(nil, 250, common.DefaultKeyMap())
m.activeTab = TabSyscalls