Skip to content

test(ui): cover formatReversalEventType's three branches directly - #8787

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-8665
Jul 26, 2026
Merged

test(ui): cover formatReversalEventType's three branches directly#8787
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-8665

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

test(ui): cover formatReversalEventType's three branches directly

Add a standalone unit test for the pure formatReversalEventType helper,
asserting each of its three branches: the headline reversal_reverted ->
"merge reverted" case, reversal_reopened -> "close reopened", and the
generic underscore-humanizing fallback. Previously only the reopened arm
was exercised, and only indirectly through ReversalHealthCard's render, so
a regression in the reverted or fallback comparison went uncaught.

Closes #8665

Validation

Verified locally on this branch before opening:

  • npm run typecheck
  • npx turbo run build:tsc build:verify
  • npm run test:coverage — patch coverage 100.0% of changed lines

Add a standalone unit test for the pure formatReversalEventType helper,
asserting each of its three branches: the headline reversal_reverted ->
"merge reverted" case, reversal_reopened -> "close reopened", and the
generic underscore-humanizing fallback. Previously only the reopened arm
was exercised, and only indirectly through ReversalHealthCard's render, so
a regression in the reverted or fallback comparison went uncaught.

Closes JSONbored#8665
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 26, 2026 05:50
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 26, 2026
@loopover-orb

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-26 05:54:44 UTC

1 file · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds a standalone unit test file directly exercising the pure formatReversalEventType helper across its three branches: the reversal_reverted headline case, reversal_reopened, and the generic underscore-humanizing fallback. The test is straightforward, correctly imports the helper, and closes issue #8665 by adding direct coverage that previously only existed indirectly via component render tests. This is a narrow, well-targeted test-only addition with no production code changes.

Nits — 3 non-blocking
  • The inline comment block at the top of the test file is quite long (6 lines) for a test file; a shorter comment referencing the issue would suffice.
  • Consider a table-driven or it.each test structure for the three branches to reduce duplication as more event types are added.
  • apps/loopover-ui/src/lib/reversal-event-type-format.test.ts: could use it.each to parametrize the three cases if more event types are added later.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8665
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 44 registered-repo PR(s), 29 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bitfathers94; Gittensor profile; 44 PR(s), 0 issue(s).
Improvement ℹ️ Insufficient signal risk: clean · value: insufficient-signal · LLM: minor
Linked issue satisfaction

Addressed
The PR adds a new test file with direct unit assertions covering all three branches of formatReversalEventType: reversal_reverted, reversal_reopened, and the generic fallback, exactly as required by the three deliverables.

Review context
  • Author: bitfathers94
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript
  • Official Gittensor activity: 44 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit f378f21 into JSONbored:main Jul 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(ui): formatReversalEventType's headline 'merge reverted' branch has zero direct test coverage

1 participant