From ddcc8dd76c104f1056b1f31885bc49fe78af4ed9 Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Sun, 12 Jul 2026 15:06:32 -0700 Subject: [PATCH] test(signals): cover panelSummary's gateHeld-no-summary fallback 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. --- test/unit/signals-coverage.test.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/unit/signals-coverage.test.ts b/test/unit/signals-coverage.test.ts index 058712c5e3..09dc5e1e47 100644 --- a/test/unit/signals-coverage.test.ts +++ b/test/unit/signals-coverage.test.ts @@ -1478,6 +1478,29 @@ describe("signal coverage edge cases", () => { expect(actionRequiredComment).toContain("Gittensory cannot evaluate this PR until installation state is repaired."); expect(actionRequiredComment).toContain("> | Gate result | ⚠️ App action required | Install/config needs attention. | Fix app config. |"); + // REGRESSION: gateHeld's panelSummary falls back to a literal default when NO gate was passed at all -- + // gateConclusion then resolves via fallbackGateConclusion's `!args.repo` arm to "neutral" (gateHeld-only, + // unlike "action_required" above which is ALSO gateBlocking and never reaches this fallback), and + // args.gate?.summary is undefined (no gate object exists to read a summary from), so the literal default + // text renders instead of a provided/derived summary. + const heldNoSummaryComment = buildPublicPrIntelligenceComment({env: {}, + repo: null, + pr: { ...currentPr, linkedIssues: [99], body: "Fixes #99" }, + profile, + detection, + queueHealth: buildQueueHealth(directRepo, [], [currentPr], buildCollisionReport(directRepo.fullName, [], [currentPr])), + collisions: buildCollisionReport(directRepo.fullName, [], [currentPr]), + preflight: buildPreflightResult( + { repoFullName: directRepo.fullName, title: "Fix isolated issue", body: "Fixes #99", linkedIssues: [99] }, + directRepo, + [], + [currentPr], + ), + settings: gateSettings, + }); + expect(heldNoSummaryComment).toContain("> [!WARNING]"); + expect(heldNoSummaryComment).toContain("LoopOver is holding this PR for maintainer review."); + const duplicateAdvisoryComment = buildPublicPrIntelligenceComment({env: {}, repo: directRepo, pr: currentPr,