From 705c7145bd85a2c8b3ff34a347b5432a9736b1da Mon Sep 17 00:00:00 2001 From: Paul Itoi <814886+pitoi@users.noreply.github.com> Date: Sun, 30 Aug 2026 22:02:21 +0000 Subject: [PATCH] [Jamie] Fix failing unit test on PR #5200: add pipeline field to consolidated-run test fixture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## CI failure on PR #5200 `unit-tests` check fails: ``` FAIL src/__tests__/unit/components/RecursionBox.test.tsx > RecursionCard — allRuns prop (consolidated-run detection) > detects a PENDING in-flight consolidated run via the allRuns prop TestingLibraryElementError: Unable to find an element by: [data-testid="consolidated-generating"] ``` ## Cause This is the exact fixture gap flagged before merge. PR #5200 changed `RecursionCard`'s `existingConsolidated` lookup to filter on the new `pipeline === StakworkRunType.LEGAL_BENCHMARK_CONSOLIDATED` field instead of the ambiguous `runType === "recursion"`. The test's `makeConsolidatedRow` helper (in `src/__tests__/unit/components/RecursionBox.test.tsx`) builds a `BenchmarkRunListRow` fixture that never sets `pipeline`, so the new filter no longer matches it — `effectiveConsolidatedRunId` stays `null` and the "Generating…" indicator never renders. ## Fix Add `pipeline: StakworkRunType.LEGAL_BENCHMARK_CONSOLIDATED` to the `makeConsolidatedRow` helper's returned object (as a fixed value, not an override — every row this helper builds represents a consolidated run in this describe block). This is a test-only change; no production code is touched. Verified this does not change the meaning of the other two tests using this helper: - `"ignores runs with hasReport=true (already completed)"` only asserts the "Generating…" spinner (`consolidated-generating`) is absent for a completed run — still true after the fix, since a completed run should show the report link, not the spinner. Unaffected. - `"ignores consolidated runs for other task slugs"` asserts the same absence for an unrelated taskSlug — unaffected by adding `pipeline`. --- src/__tests__/unit/components/RecursionBox.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/__tests__/unit/components/RecursionBox.test.tsx b/src/__tests__/unit/components/RecursionBox.test.tsx index 3e722a325d..f02d4f8aec 100644 --- a/src/__tests__/unit/components/RecursionBox.test.tsx +++ b/src/__tests__/unit/components/RecursionBox.test.tsx @@ -972,6 +972,7 @@ describe("RecursionCard — allRuns prop (consolidated-run detection)", () => { id: overrides.id ?? "con-run-1", workspaceId: "ws-1", runType: "recursion" as const, + pipeline: "LEGAL_BENCHMARK_CONSOLIDATED" as import("@prisma/client").StakworkRunType, status: overrides.status ?? "PENDING" as import("@prisma/client").WorkflowStatus, projectId: null, taskSlug: overrides.taskSlug ?? "antitrust/task-1",