test(signals): cover panelSummary's gateHeld-no-summary fallback - #5475
Merged
Conversation
codecov/patch flagged src/signals/engine.ts's panelSummary line as partially covered after the brand rename touched it: "action_required" is BOTH gateBlocking and gateHeld, so the existing test exercising it only ever reached the gateBlocking branch of the ternary, never the gateHeld branch's own "LoopOver is holding this PR for maintainer review." literal fallback (args.gate?.summary is only ever undefined when no gate object is passed at all, which requires repo: null to resolve gateConclusion to "neutral" via fallbackGateConclusion instead). A pre-existing gap, not introduced by the rename, but surfaced by it.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5475 +/- ##
=======================================
Coverage 94.72% 94.72%
=======================================
Files 559 559
Lines 44664 44664
Branches 14664 14664
=======================================
Hits 42308 42308
Misses 1621 1621
Partials 735 735
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
Summary
Follow-up to the now-merged #5468 (check-run/PR-comment brand rename). That PR's codecov/patch check flagged
src/signals/engine.ts'spanelSummaryternary as only partially covered on the line it happened to rename — a pre-existing gap surfaced by touching the line, not a regression introduced by it, but worth closing regardless since it turned out no test at all exercised this fallback string.Root cause:
"action_required"makes gate evaluation BOTHgateBlockingandgateHeldtrue, and the ternary checksgateBlockingfirst — so the one existingaction_requiredtest in this file only ever reached thegateBlockingbranch, nevergateHeld's own"... is holding this PR for maintainer review."literal fallback. That fallback only renders whenargs.gateis entirely absent (not just missing asummary, since the type requiressummary: string), which requiresrepo: nullsogateConclusionresolves to"neutral"viafallbackGateConclusion's!args.repoarm instead. Same pattern as an existing adjacent test for the siblingbuildPublicPrPanelSignalRowsfunction (test/unit/signals-coverage.test.ts:816-818).No production code changes — test-only.
Test plan
npm run typecheckcleannpm run test:cigreen (786/788 test files, 2 pre-existing skips)npm audit --audit-level=moderate— 0 vulnerabilitiesnpm run test:coveragethatsrc/signals/engine.tsis now at 99.26%/98.06% (stmt/branch), with the target lines no longer in the uncovered list