diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-10 23:19:52 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-10 23:19:52 +0200 |
| commit | 802033de1954bd2fe5e912002fb6c8a07743b66d (patch) | |
| tree | 63b7a61c3dfcc31ca6a7b85af73a959c04473445 /internal/tui/dashboard/model_test.go | |
| parent | f78f9110e9932a559a225104dd8115514d30af59 (diff) | |
dashboard: centralize nil snapshot fallback (task 385)
Diffstat (limited to 'internal/tui/dashboard/model_test.go')
| -rw-r--r-- | internal/tui/dashboard/model_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/tui/dashboard/model_test.go b/internal/tui/dashboard/model_test.go index 59af73a..8c73230 100644 --- a/internal/tui/dashboard/model_test.go +++ b/internal/tui/dashboard/model_test.go @@ -75,6 +75,15 @@ func TestFlameViewportClampsHeightWithExpandedHelp(t *testing.T) { } } +func TestSnapshotOrZeroReturnsZeroSnapshotWhenLatestMissing(t *testing.T) { + m := NewModelWithConfig(nil, nil, 250, common.DefaultKeyMap()) + + snap := m.snapshotOrZero() + if snap.SyscallsCount() != 0 || snap.FilesCount() != 0 || snap.ProcessesCount() != 0 { + t.Fatalf("snapshotOrZero() should return an empty snapshot when latest is nil, got counts %d/%d/%d", snap.SyscallsCount(), snap.FilesCount(), snap.ProcessesCount()) + } +} + func TestKeySwitchingChangesActiveTab(t *testing.T) { m := NewModelWithConfig(nil, nil, 250, common.DefaultKeyMap()) |
