Skip to main content

Provider Directory Service — Testing Strategy

Status: populated Owner: TBD Last updated: 2026-04-17

1. Coverage Targets

LayerTarget
Domain≥ 95%
Application≥ 90%
Infrastructure≥ 80%
Presentation≥ 80%
Overall≥ 80% line / ≥ 70% branch

2. Unit tests

AreaKey cases
Practitioner aggregateOfficial name required; identifier uniqueness per authority
CredentialExpiry state transitions; revoke blocks active roles that depend on it
RolePrivilege gating (BR-PROV-001); deactivation side-effects
HealthcareServiceSpecialty code validation
ServiceEndpointAuth-method matrix; health-state transitions

3. Integration tests

Mandatory platform three:

SpecPurpose
tenant-isolation.spec.tsRLS
outbox.spec.tsOutbox → NATS
inbox.spec.tsDedup on identity.user.registered.v1

Service-specific:

SpecPurpose
credential-expiry-job.integration.spec.tsScheduled scan → events
privilege-cascade.integration.spec.tsRevoke credential → roles auto-demoted
search-multi-script.integration.spec.ts"Ahmad" ↔ "احمد" results
endpoint-healthcheck.integration.spec.tsPeriodic probe state transitions
fhir-practitioner.integration.spec.tsFHIR R4 CRUD

4. Contract tests

ConsumerWhat
scheduling-servicepractitioner.created/updated event shape
orders-service/internal/privileges response
facility-servicepractitioner.created triggering membership
interop-serviceFHIR projection

5. E2E tests

FlowTool
Onboard consultant with credentials and assign rolePlaywright
Credential expiry fires notificationPlaywright + scheduler harness
Search by local-script namePlaywright

6. Performance tests

ScenarioTarget
Privilege check 2000 rpsp99 ≤ 30ms
Search 500 rpsp95 ≤ 500ms
Credential scan 100k rows≤ 5 minutes

7. Security tests

  • RLS verified per role.
  • Credential number never returned in search responses.
  • Deactivated practitioner cannot be assigned a new role.