Q159: the home page's recent runs are the newest ones

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-09 02:33:37 -04:00
1 parent 9d166e3fc9
commit 459dcf0ea2
3 files changed
+16 -1

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
import { describe, expect, test } from "vitest";
import { newestRuns } from "../../src/renderer/src/pages/runs/newest-runs";
describe("the home page's recent runs", () => {
test("are the newest ones, newest first, from the snapshot's oldest-first list", () => {
const runs = Array.from({ length: 10 }, (_, index) => ({ id: `run_${index}` }));
expect(newestRuns(runs, 3).map((run) => run.id)).toEqual(["run_9", "run_8", "run_7"]);
expect(newestRuns(runs.slice(0, 2), 6).map((run) => run.id)).toEqual(["run_1", "run_0"]);
});
});