⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
apps/loopover-ui/src/components/site/app-panels/reversal-health-card-model.ts:28-32's
formatReversalEventType has three branches:
export function formatReversalEventType(eventType: string): string {
if (eventType === "reversal_reverted") return "merge reverted";
if (eventType === "reversal_reopened") return "close reopened";
return eventType.replaceAll("_", " ");
}
Only the "reversal_reopened" branch is exercised today, indirectly, via
reversal-health-card.test.tsx's render of a reversedTargets entry. The "reversal_reverted"
branch — the case that names bot-merge reverts, the headline event this entire card exists to
surface — and the generic fallback branch are never called anywhere in the test suite (confirmed by
repo-wide grep: formatReversalEventType appears only in its own definition and its one .tsx call
site). A typo or refactor regression in the "reversal_reverted" string comparison would go
completely undetected by the current test suite.
Requirements
- Add direct unit test coverage for all three branches of
formatReversalEventType, not just the
one currently exercised indirectly through a component render.
Deliverables
All three Deliverables are required in the same PR.
Test Coverage Requirements
apps/** is excluded from codecov/patch gating (see codecov.yml), but
apps/loopover-ui's own local vitest coverage thresholds still apply — the three new assertions
must be direct unit tests on formatReversalEventType itself (not indirect component-render
inference), so all three branches show real, attributable coverage.
Expected Outcome
All three branches of formatReversalEventType — including the headline "merge reverted" case —
have direct, explicit test coverage, so a future regression in any one of them is caught
immediately.
Links & Resources
apps/loopover-ui/src/components/site/app-panels/reversal-health-card-model.ts:28-32
apps/loopover-ui/src/components/site/app-panels/reversal-health-card.test.tsx (existing test file
to extend)
Context
apps/loopover-ui/src/components/site/app-panels/reversal-health-card-model.ts:28-32'sformatReversalEventTypehas three branches:Only the
"reversal_reopened"branch is exercised today, indirectly, viareversal-health-card.test.tsx's render of areversedTargetsentry. The"reversal_reverted"branch — the case that names bot-merge reverts, the headline event this entire card exists to
surface — and the generic fallback branch are never called anywhere in the test suite (confirmed by
repo-wide grep:
formatReversalEventTypeappears only in its own definition and its one.tsxcallsite). A typo or refactor regression in the
"reversal_reverted"string comparison would gocompletely undetected by the current test suite.
Requirements
formatReversalEventType, not just theone currently exercised indirectly through a component render.
Deliverables
formatReversalEventType("reversal_reverted") === "merge reverted".formatReversalEventType("reversal_reopened") === "close reopened"(may already be indirectly covered, but must exist as a direct unit assertion on the function
itself, not just inferred from a component snapshot).
formatReversalEventType("some_new_event") === "some new event".All three Deliverables are required in the same PR.
Test Coverage Requirements
apps/**is excluded fromcodecov/patchgating (seecodecov.yml), butapps/loopover-ui's own local vitest coverage thresholds still apply — the three new assertionsmust be direct unit tests on
formatReversalEventTypeitself (not indirect component-renderinference), so all three branches show real, attributable coverage.
Expected Outcome
All three branches of
formatReversalEventType— including the headline "merge reverted" case —have direct, explicit test coverage, so a future regression in any one of them is caught
immediately.
Links & Resources
apps/loopover-ui/src/components/site/app-panels/reversal-health-card-model.ts:28-32apps/loopover-ui/src/components/site/app-panels/reversal-health-card.test.tsx(existing test fileto extend)