test(clinical): content-first + governance-badge regression tests (resolve #015)#1057
Conversation
Cover the content-first transitions flagged in #1024's CodeRabbit review for the two record loaders, locking in the clinical-safety invariant that no authoritative verification badge is asserted before live governance reconciles: - registry-record-loader.dom.test.tsx (8 tests): fallback paint during loading, the fixture-flag neutralization on the provisional paint, spinner when no fallback, live swap-in reconciling the badge on/off against governance, passthrough when governance is absent, and not_found / unauthorized states. - medication-record-page.dom.test.tsx (6 tests): fallback paint vs skeleton, live swap-in, error-empty panel, and the governance-drop-on-error invariant (a fixture "Reviewed" badge must not persist after an error) contrasted with the in-flight loading state that trusts the SSR governance. Test-only; no source/behaviour change. 14/14 pass under the jsdom project. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move #15 to Resolved/archive; covered by the two new jsdom suites in this PR. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdded DOM regression suites for content-first rendering in ChangesContent-first regression tests
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
Resolves ledger #15 (CodeRabbit nitpick on #1024): add focused regression tests for the content-first record loaders, locking in the clinical-safety invariant that no authoritative verification badge is asserted before live governance reconciles.
tests/registry-record-loader.dom.test.tsx(8 tests): fallback record paints immediately during loading; the fixturelocallyVerifiedflag is neutralized on the provisional paint; spinner when there is no fallback; live swap-in reconciles the flag on/off againstgovernance.validationStatus; passthrough when governance is absent;not_foundandunauthorizedempty states.tests/medication-record-page.dom.test.tsx(6 tests): fallback paint vs skeleton; live swap-in prefers the live record; error-empty panel; and the governance-drop-on-error invariant — a fixture "Reviewed" badge must not survive an error — contrasted with the in-flight loading state that trusts the SSR governance.Verification
vitest run(jsdom project): 14/14 passtsc --noEmitclean ·eslint --max-warnings 0clean ·prettier --checkcleandocs:check-linkspasses (ledger move)Governance
src/**behaviour changed).🤖 Generated with Claude Code
Summary by CodeRabbit