diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-24 08:38:19 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-24 08:38:19 +0200 |
| commit | b01e24374398eb3d343e9472f3262668039db56c (patch) | |
| tree | 139a9e02946f635adaeedb8a61fa150c874c17ff /internal/tui/dashboard/model_test.go | |
| parent | 24b401ac9c6a1f80b5ba7f446f1fd3e3ddf02b5c (diff) | |
tui: add dashboard syscalls 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 ddb457a..8899e72 100644 --- a/internal/tui/dashboard/model_test.go +++ b/internal/tui/dashboard/model_test.go @@ -43,6 +43,23 @@ func TestKeySwitchingChangesActiveTab(t *testing.T) { } } +func TestSyscallsTabScrollsWithJK(t *testing.T) { + m := NewModelWithConfig(nil, 250, tui.DefaultKeyMap()) + m.activeTab = TabSyscalls + + next, _ := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'j'}}) + model := next.(Model) + if model.syscallsOffset != 1 { + t.Fatalf("expected offset 1 after j, got %d", model.syscallsOffset) + } + + next, _ = model.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'k'}}) + model = next.(Model) + if model.syscallsOffset != 0 { + t.Fatalf("expected offset 0 after k, got %d", model.syscallsOffset) + } +} + func TestRefreshTickEmitsStatsTickMsg(t *testing.T) { snap := &statsengine.Snapshot{TotalSyscalls: 9} engine := &fakeSnapshotSource{snap: snap} |
