diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-24 08:49:57 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-24 08:49:57 +0200 |
| commit | 13a81c7fdbaab8ef650a7487270abb6776f0b4cd (patch) | |
| tree | 111a76dfb4516a62ed166b2a4486214f1034929d /internal/tui/dashboard/model_test.go | |
| parent | e5116514c33b2fce6ce2fc7904d6720c5236221f (diff) | |
tui: add dashboard processes table tab
Diffstat (limited to 'internal/tui/dashboard/model_test.go')
| -rw-r--r-- | internal/tui/dashboard/model_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/tui/dashboard/model_test.go b/internal/tui/dashboard/model_test.go index 8899e72..3d93659 100644 --- a/internal/tui/dashboard/model_test.go +++ b/internal/tui/dashboard/model_test.go @@ -60,6 +60,23 @@ func TestSyscallsTabScrollsWithJK(t *testing.T) { } } +func TestProcessesTabScrollsWithJK(t *testing.T) { + m := NewModelWithConfig(nil, 250, tui.DefaultKeyMap()) + m.activeTab = TabProcesses + + next, _ := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'j'}}) + model := next.(Model) + if model.processesOffset != 1 { + t.Fatalf("expected processes offset 1 after j, got %d", model.processesOffset) + } + + next, _ = model.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'k'}}) + model = next.(Model) + if model.processesOffset != 0 { + t.Fatalf("expected processes offset 0 after k, got %d", model.processesOffset) + } +} + func TestRefreshTickEmitsStatsTickMsg(t *testing.T) { snap := &statsengine.Snapshot{TotalSyscalls: 9} engine := &fakeSnapshotSource{snap: snap} |
