[Jamie] Fix failing unit test on PR #5200: add pipeline field to consolidated-run test fixture - #5202
Merged
Merged
Conversation
…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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI failure on PR #5200
unit-testscheck fails:Cause
This is the exact fixture gap flagged before merge. PR #5200 changed
RecursionCard'sexistingConsolidatedlookup to filter on the newpipeline === StakworkRunType.LEGAL_BENCHMARK_CONSOLIDATEDfield instead of the ambiguousrunType === "recursion". The test'smakeConsolidatedRowhelper (insrc/__tests__/unit/components/RecursionBox.test.tsx) builds aBenchmarkRunListRowfixture that never setspipeline, so the new filter no longer matches it —effectiveConsolidatedRunIdstaysnulland the "Generating…" indicator never renders.Fix
Add
pipeline: StakworkRunType.LEGAL_BENCHMARK_CONSOLIDATEDto themakeConsolidatedRowhelper'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 addingpipeline.