Skip to content

Chehan branch#4

Merged
chehanw merged 2 commits intomainfrom
Chehan-branch
Jan 28, 2026
Merged

Chehan branch#4
chehanw merged 2 commits intomainfrom
Chehan-branch

Conversation

@chehanw
Copy link
Collaborator

@chehanw chehanw commented Jan 28, 2026

Enrollment flow polish + Jest service testing framework

♻️ Current situation & Problem

This PR improves overall stability and developer velocity by:

  • Adding a Jest-based unit testing framework for core services so CI can reliably validate logic as the codebase grows.
  • Smoothing the enrollment flow by wiring the medical history chatbot stub into navigation and fixing UI issues (including IPSS survey scroll/keyboard overlap).

There are no linked issues or prior PRs associated with this change.


⚙️ Release Notes

  • Add Jest unit test coverage for core services (Account, Consent, HealthKit, Onboarding).
  • Introduce feature-flagged tests for in-progress integrations (Throne API, Firebase backend factory).
  • Improve enrollment UX by integrating the medical chatbot stub into the app flow and fixing IPSS survey scroll/keyboard overlap issues.
  • Update CLAUDE.md to reflect the current enrollment flow and testing approach.

Notes / migration

  • No breaking public interface changes are intended.
  • Local test commands:
    • npm test
    • npm run test:services

📚 Documentation

  • Updated CLAUDE.md to align with the current enrollment flow and testing setup.
  • No changes were made to the ordering of the enrollment flow; this PR focuses on wiring, stability, and polish.

✅ Testing

Framework: Jest

Actively tested (running now)

These tests run as part of npm test / npm run test:services:

  • AccountService: account creation, profile updates, and persistence
  • ConsentService: consent recording, version tracking, and withdrawal logic
  • HealthKitService: authorization requests and data queries (mocked)
  • OnboardingService: state machine transitions and data persistence
  • Questionnaire components: FHIR type definitions and validation schemas

Flagged / skipped (waiting for implementation)

These tests are present but intentionally skipped until feature flags are enabled:

  • ThroneService
    • getMeasurements and getLatestMeasurement real API calls are skipped
    • Current tests validate stub behavior only
    • Controlled by: FEATURE_FLAGS.THRONE_API_IMPLEMENTED (currently false)
  • BackendFactory
    • Firebase backend creation tests are skipped
    • Controlled by: FEATURE_FLAGS.FIREBASE_BACKEND_IMPLEMENTED (currently false)

Why some elements are not fully testable yet

  • External integrations (Throne API and Firebase) are still under developmen

@chehanw chehanw merged commit a1b44a4 into main Jan 28, 2026
5 checks passed
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