Skip to content

Support practitioner launch context in questionnaire test toolkit - #2193

Draft
pavlushkin wants to merge 3 commits into
aehrc:mainfrom
beda-software:feature/questionnaire-test-toolkit-user-context
Draft

pavlushkin wants to merge 3 commits into
aehrc:mainfrom
beda-software:feature/questionnaire-test-toolkit-user-context

Conversation

@pavlushkin

Copy link
Copy Markdown
Contributor

The GP CCMP population tests need practitioner and PractitionerRole launch context, but published @aehrc/questionnaire-test-toolkit@0.1.0 accepts only patient context. This change adds the missing inputs so the suite can run from the IG repository using the published toolkit.

Changes

  • Add optional user and fhirContext wrapper props; forward them to population, expose the practitioner to renderer expressions, and repopulate when either input changes.
  • Make selectTab leave an already expanded accordion open while preserving normal clicks for other tabs.
  • Prepare toolkit version 0.1.1, keeping the existing renderer and SDC dependency baseline and dual ESM/CJS package exports.
  • Add eight persistent regression tests against the built public package. These cover independent user/context rerenders, context isolation, tab behavior, validation, terminology URL configuration and extraction.
  • Run the toolkit tests and typechecking in the shared Build-Test-Lint workflow on Node 24. The existing release workflow also calls this workflow.

The context rerender test keeps the same request-definition array across renders and changes only fhirContext. The fixtures have no external ValueSets, so these regression tests do not depend on Ontoserver.

Validation

  • Toolkit regression suite: 8/8 passed across two files.
  • Toolkit and regression-test typechecking: passed.
  • Three separate temporary mutations were rejected by the corresponding tests: removing the user dependency, removing the fhirContext dependency, and removing the expanded-tab guard. The original build was restored and the normal suite passed again.
  • ESLint on applicable added files, Prettier, workflow YAML validation and diff whitespace checks: passed.
  • npm package dry run: nine files; ESM/CJS and both declaration formats remain present, and test sources/configuration are excluded.
  • During the underlying context implementation, packed-consumer acceptance passed and the existing Aboriginal extraction suite passed 26/26. The new committed tests additionally correct and preserve the isolated context-rerender check.

Release dependency

This is the toolkit prerequisite for aehrc/gpccmp-fhir-ig#8. Merging this PR does not publish a package: a maintainer must release questionnaire-test-toolkit@0.1.1 through the existing release workflow. After publication, the IG lockfile must be regenerated from npm and the actual registry artifact, clean installation, 41-test suite and CI verified. The earlier packed candidate integrity must not be assumed to match the final published tarball.

Add optional user and fhirContext inputs to BehavioralTestWrapper,
forward them through population and renderer context, and rerun
population when either changes. Make selectTab idempotent for an
already-expanded accordion.

Bump the package to 0.1.1 and document the population contract. The
packed artifact passes strict ESM/CJS declaration checks and eight
external-consumer acceptance cases; the 26-test Aboriginal extraction
suite also passes.

Forward-ports c1c1c4d
@leoniedickson

Copy link
Copy Markdown
Collaborator

Thanks @pavlushkin - could we start a CHANGELOG.md for this package?

@pavlushkin

pavlushkin commented Oct 26, 2026 via email

Copy link
Copy Markdown
Contributor Author

@pavlushkin

Copy link
Copy Markdown
Contributor Author

Follow-up toolkit PR (saved responses, comparison extraction, strict interaction guards, population callback seam, repeat helpers and Health Check acceptance) opened against this branch: beda-software#27. It will be retargeted to main after this PR merges.

@pavlushkin

Copy link
Copy Markdown
Contributor Author

Follow-up toolkit PR (saved responses, comparison extraction, strict interaction guards, population callback seam, repeat helpers and Health Check acceptance): #2194 — built on top of this branch and will be rebased onto main after this PR merges.

@pavlushkin
pavlushkin marked this pull request as draft October 27, 2026 09:31

This branch has not been deployed

No deployments
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.

2 participants