diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-09 23:01:38 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-09 23:01:38 +0200 |
| commit | 227de0db390fec4e1327a7cab6be4c1268848695 (patch) | |
| tree | f70ff9f3b23db47db0e0aeafa1bb1aad5abc71a8 /internal/tui/dashboard/processes_test.go | |
| parent | bcaa22111ac619e317f7adfd60a1fc6bd4db8d29 (diff) | |
tui: add reverse sorting for dashboard tables (task 364)
Diffstat (limited to 'internal/tui/dashboard/processes_test.go')
| -rw-r--r-- | internal/tui/dashboard/processes_test.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/tui/dashboard/processes_test.go b/internal/tui/dashboard/processes_test.go index 7c04497..d2cd412 100644 --- a/internal/tui/dashboard/processes_test.go +++ b/internal/tui/dashboard/processes_test.go @@ -28,7 +28,7 @@ func TestRenderProcessesIncludesHeaders(t *testing.T) { if !strings.Contains(out, "100") || !strings.Contains(out, "proc-a") { t.Fatalf("expected process row in output") } - if !strings.Contains(out, "s:sort") { + if !strings.Contains(out, "s/S:sort") { t.Fatalf("expected processes sort hint in output") } if !strings.Contains(out, "sort: default") { @@ -75,4 +75,9 @@ func TestSortedProcessTableRowsUsesSelectedSortKey(t *testing.T) { if sorted[0].PID != 100 { t.Fatalf("expected pid asc sort to put PID 100 first, got %d", sorted[0].PID) } + + sorted = sortedProcessTableRows(rows, tableSortState[processSortKey]{active: true, key: processSortKeyComm, reverse: true}) + if sorted[0].PID != 200 { + t.Fatalf("expected reverse comm sort to put PID 200 first, got %d", sorted[0].PID) + } } |
