Skip to content

test(clinical): content-first + governance-badge regression tests (resolve #015)#1057

Merged
BigSimmo merged 2 commits into
mainfrom
claude/content-first-regression-tests
Jul 22, 2026
Merged

test(clinical): content-first + governance-badge regression tests (resolve #015)#1057
BigSimmo merged 2 commits into
mainfrom
claude/content-first-regression-tests

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 22, 2026

Copy link
Copy Markdown
Owner

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 fixture locallyVerified flag is neutralized on the provisional paint; spinner when there is no fallback; live swap-in reconciles the flag on/off against governance.validationStatus; passthrough when governance is absent; not_found and unauthorized empty 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 pass
  • tsc --noEmit clean · eslint --max-warnings 0 clean · prettier --check clean
  • docs:check-links passes (ledger move)

Governance

  • RAG impact: no retrieval behaviour change — test-only additions + a ledger row move (no src/** behaviour changed).
  • Clinical governance preflight: test-only. These tests lock in existing conservative-failure behaviour (badge withheld until governance reconciles); they change no ingestion, answer-generation, retrieval, or document-access code.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Record pages now display available content immediately while live details load.
    • Live data and governance status update the displayed record once available.
    • Added clear handling for loading, empty, unauthorized, error, and not-found states.
  • Bug Fixes
    • Prevented provisional content from showing authoritative verification badges before live status is confirmed.
    • Ensured outdated fallback content is replaced with current live information.
  • Documentation
    • Updated outstanding issue tracking to reflect completion of the related work.

BigSimmo and others added 2 commits July 22, 2026 09:40
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>
@BigSimmo
BigSimmo enabled auto-merge (squash) July 22, 2026 01:42
@supabase

supabase Bot commented Jul 22, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5076a52d-9bd9-4ffc-8261-25b209180335

📥 Commits

Reviewing files that changed from the base of the PR and between ca08128 and 8c0a5a9.

📒 Files selected for processing (3)
  • docs/outstanding-issues.md
  • tests/medication-record-page.dom.test.tsx
  • tests/registry-record-loader.dom.test.tsx

📝 Walkthrough

Walkthrough

Added DOM regression suites for content-first rendering in RegistryRecordLoader and MedicationRecordPage, covering fallback paints, live swaps, governance reconciliation, loading, errors, unauthorized access, and empty states. Documented issue #015 as completed.

Changes

Content-first regression tests

Layer / File(s) Summary
Registry loader state coverage
tests/registry-record-loader.dom.test.tsx
Mocks registry hook state and verifies fallback rendering, loading indicators, governance-driven verification changes, not-found handling, and unauthorized handling.
Medication page rendering coverage
tests/medication-record-page.dom.test.tsx, docs/outstanding-issues.md
Mocks medication detail state and verifies fallback/live content switching, loading and error behavior, governance badge handling, and issue #015 completion tracking.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the focused regression-test and ledger-resolution changes.
Description check ✅ Passed The summary and verification details are solid, but the template's Risk/Rollout and Clinical Governance Preflight sections are missing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/content-first-regression-tests

Comment @coderabbitai help to get the list of available commands.

@BigSimmo
BigSimmo merged commit ac217b1 into main Jul 22, 2026
18 checks passed
@BigSimmo
BigSimmo deleted the claude/content-first-regression-tests branch July 22, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant