Add QTI viewer acceptance test infrastructure#14620
Open
rtibbles wants to merge 5 commits into
Open
Conversation
Spec and implementation plan for fixture-driven acceptance tests. Shared renderAssessmentItem helper that renders AssessmentItem with parsed fixture XML and mocked injectables (handlers, QTI_CONTEXT, answerState, interactive). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Build Artifacts
Smoke test screenshot |
rtibbles
commented
Apr 21, 2026
Member
Author
rtibbles
left a comment
There was a problem hiding this comment.
A couple of tweaks needed.
20 behavioral fixtures covering single/multi select, maxChoices enforcement, orientation, stacking, response processing templates, shuffle, and SBAC items. Tests selection, deselection, keyboard interaction, ARIA semantics, and answer state round-tripping. 182 tests total (with TextEntry). 69 fail pending PR learningequality#14374 (role=listbox, aria-multiselectable, maxChoices, shuffle.value). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 behavioral fixtures covering string/float base types, pattern-mask, composite (17 inputs), and adaptive items. Tests input type, typing, answer state round-tripping, external reactivity, and non-interactive mode. 12 tests fail pending PR learningequality#14374 (aria-label, autocomplete=off). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds 5 new fixtures covering interaction types identified in the 1EdTech canonical examples gap analysis: - associate-interaction-1: pair matching (country to capital) - slider-interaction-1: numeric slider (boiling point) - drawing-interaction-1: freehand drawing on image (file response) - upload-interaction-1: file upload (essay submission) - upload-composite-1: file upload combined with text entry These scaffold future component development and acceptance tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JS test fixtures stored via git-lfs (e.g. the QTI items.js fixture bundle) need to be resolved to their actual content before Jest runs; without lfs: true on the checkout step the pointer file is parsed as JS and the suite fails to load.
83cc06a to
ff2e21a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds acceptance-test infrastructure for the QTI viewer plugin —
renderAssessmentItemharness plus fixture-driven specs forChoiceInteractionandTextEntryInteraction. Adds fixtures for the remaining QTI interaction types (not yet covered by specs) so future tests can land incrementally.Fixes a Vue 2 binding quirk in
SimpleChoiceandChoiceInteractionwhere booleanfalsecausedaria-selectedandaria-multiselectableto be stripped from the DOM. Completes the intent of #14374 for the initial/unselected and single-cardinality cases —String()coercion keeps the attributes present in both states.References
ChoiceInteraction/TextEntryInteraction. This PR completes the ARIA intent of that change for the unselected/single-cardinality cases.Reviewer guidance
Primary purpose of this PR is to establish the acceptance-test harness and spec style — future interaction specs (ExtendedText, Slider, etc.) will follow the smoke-vs-behaviour split used here, so worth confirming that shape is right before it becomes a pattern.
Only manual check needed: open the sandbox QTI viewer, inspect a
qti-simple-choiceand itsul[role="listbox"], and confirmaria-selected="false"/aria-multiselectable="false"are present on unselected items. ARIA state attributes require an explicit"false"string — they are enumerated, not boolean like HTMLdisabled/checked, so Vue 2's boolean-attribute handling incorrectly strips them. See Hidde de Vries on boolean attributes in HTML and ARIA.AI usage
Both passes used Claude Code. First pass generated the initial acceptance-test harness, fixtures, and behavioural specs for
ChoiceInteractionandTextEntryInteraction— prompted to establish Vue Testing Library infrastructure and conventions for QTI interaction components, with fixture-driven coverage of each behaviour. Second pass was a cleanup: I asked Claude to audit the branch againstdevelop, which surfaced the Vue 2 boolean-ARIA stripping bug (completing #14374 for the unselected case), agetByRole('listbox')test bug on multi-interaction fixtures, test verbosity (155 cases, much of it redundant across fixtures), and some committed plan docs. I directed each fix, prompted for aggressive pruning after the first refactor pass (155 → 53 cases), and reviewed the absorbed history and final diff via local-review before pushing.