Skip to content

[Jamie] Fix failing unit test on PR #5200: add pipeline field to consolidated-run test fixture - #5202

Merged
pitoi merged 1 commit into
masterfrom
swarm/swarm-change-bee05800
Aug 30, 2026
Merged

[Jamie] Fix failing unit test on PR #5200: add pipeline field to consolidated-run test fixture#5202
pitoi merged 1 commit into
masterfrom
swarm/swarm-change-bee05800

Conversation

@pitoi

@pitoi pitoi commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

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.

…olidated-run test fixture

## 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`.
@pitoi pitoi added the jamie Automated PR opened by Jamie label Aug 30, 2026 — with Hive Chat PM
@pitoi
pitoi merged commit 78da1a3 into master Aug 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jamie Automated PR opened by Jamie

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant