test(ui): cover formatReversalEventType's three branches directly - #8782
test(ui): cover formatReversalEventType's three branches directly#8782nghetien wants to merge 1 commit into
Conversation
Add direct unit assertions for the reversal_reverted, reversal_reopened, and fallback branches of formatReversalEventType, previously exercised only indirectly through the ReversalHealthCard render tests.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 05:16:23 UTC
Review summary Nits — 2 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk 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.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll preview
A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 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.
|
|
This pull request changes UI/visual code but its screenshot evidence is incomplete. Every required viewport × theme combination needs its own before/after image pair in a labeled table row (e.g. "Desktop · Light | before | after"). Still missing: Desktop · Dark, Tablet · Dark, Mobile · Dark. Please resubmit with the remaining rows filled in. See https://github.com/JSONbored/loopover/blob/main/.claude/skills/contributing-to-loopover/SKILL.md for the exact format and examples. This is an automated maintenance action. |


The formatReversalEventType helper in reversal-health-card-model.ts has three branches (reversal_reverted, reversal_reopened, and a generic fallback), but only reversal_reopened was exercised, and only indirectly through a ReversalHealthCard render assertion. This adds direct unit tests for all three branches, including the previously-uncovered "merge reverted" case.
Closes #8665
Validation
npx vitest run src/components/site/app-panels/reversal-health-card.test.tsx— 9/9 passednpm --workspace @loopover/ui run test— 88 files / 626 tests passednpm --workspace @loopover/ui-miner run test— 37 files / 393 tests passednpm test(root suite) — 1156 files / 21627 tests passednpm run test:workers— 3/3 passednpm run typecheck,npm run actionlint, and the full drift/manifest/reference check suite — all greennpx turbo run lint --filter=@loopover/ui --filter=@loopover/ui-miner— 0 errors