Repository navigation
test(a11y): cover the K-2 instant quiz in the ActivityPlayer accessibility suite (#965) - #966
Merged
Conversation
…ility suite - Wait for Bright-Bots-Initiative#952 (harness item Bright-Bots-Initiative#90) and Bright-Bots-Initiative#161 to merge. Then work in `ActivityPlayerA11y.test.tsx` as Bright-Bots-Initiative#952 leaves it. - Add a second top-level `describe("ActivityPlayer Accessibility — K-2 instant quiz", ...)` beside the existing one. Leave the existing `describe` and its `it` byte-identical. - Give the new `describe` its own `beforeEach`, mirroring Bright-Bots-Initiative#952's: - call `vi.resetAllMocks()`, `__resetGradeBandCache()` and `localStorage.clear()`; - resolve `api.getStudentCourses` to `[{ gradeBand: "k2" }]`. That makes the K-2 intent explicit, though `k2` is also the fallback; - resolve `api.getModule` to a module whose activity `a-1` is a `story_quiz` with one slide and two questions. With two questions, the first feedback button reads "Next". - Add one `it` that: 1. renders the same route as the existing case; 2. waits for the slide, then clicks "Start Quiz"; 3. waits for `data-testid="instant-quiz"`; 4. finds `getByRole("group", { name: <first prompt> })`; 5. for every choice text, asserts `within(group).getByRole("button", { name: <text> })` exists and has no `aria-pressed` attribute; 6. clicks the correct choice; 7. asserts one `role="status"` element with `aria-live="polite"`, and that `getByRole("button", { name: "Next" })` has focus; 8. asserts again that every choice in the group has no `aria-pressed`, now in the feedback phase. - Do not answer the last question or finish the quiz. Completion is covered elsewhere, and finishing would add a `completeActivity` call this test does not need. - Two-phase proof, with nothing committed. First run the file and record it green, with 2 passed and 0 skipped. Then make each temporary break below on its own, run the file, record the failing assertion, and revert: - Add `aria-pressed={false}` to the `QuestionScreen` choice `Button`. Step 5 fails. - Add `aria-pressed={phase === "feedback" ? origIdx === selectedChoiceIndex : undefined}` instead. Only step 8 fails. - Drop `aria-labelledby` from the group. Step 4 fails. - Replace the choice label span's text with a fixed string. Step 5 fails on the button name. - Remove `aria-live="polite"` from `FeedbackPanel`. Step 7 fails on the live region. - Remove `autoFocus` from `FeedbackPanel`. Step 7 fails on focus. End by showing the file green again. Co-authored-by: jgoetzmann <95732896+jgoetzmann@users.noreply.github.com>
BrightBoost-Tech
merged commit Nov 18, 2026
d6685d1
into
Bright-Bots-Initiative:main
7 checks passed
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.
Closes #965
Opened by the Bright Bots Harness from
jgoetzmann-bot. It cannot merge this and will not push again unless you ask it to. Work item: jgoetzmann/bright-bots-harness#162.Review requested from @BrightBoost-Tech, @jgoetzmann.
Steering it from here
Put one of these on its own line in a comment on this pull request:
/harness revise <notes>/harness rebasemain, then push again/harness stop/harness goputs it back/harness statusHonoured only from @BrightBoost-Tech, @jgoetzmann, and only when GitHub also reports you as an owner, member or collaborator here, or
.harness/trust.txtvouches for your exact account. Everyone else's comments are read and ignored. A command is acted on once — editing a comment does not re-fire it, so post a new one.If the checks are not running
GitHub holds workflow runs from an account with no merged contribution here, so the first pull request from this one needs a maintainer to press Approve and run in the checks list on this page. Later ones start on their own.
Review checklist
From
CONTRIBUTING.md. The harness ran the first three itself, on this branch:npm run build, on this branchnpm run lintnpm run test:unitprompts/implement.mdin the harness repository, pinned by content hash; the full transcript istranscript.jsonlin the review packageWhat this change is, and why
Diagnosis
The K-2 quiz's accessibility contract is tested only at component level. No test mounts it through
ActivityPlayerand checks the contract a K-2 student actually gets.k2band freezes the"instant"variant at quiz entry (src/pages/ActivityPlayer.tsx:330-332,787-791)."instant"mountsK2InstantFeedbackQuiz(ActivityPlayer.tsx:820-831).g3_5course resolves tok2(src/hooks/useGradeBand.ts:48-54). So do the pending and failed states (useGradeBand.ts:18,163).QuestionScreenrenders the choices inrole="group"witharia-labelledbypointing at the prompt (src/components/activities/quiz/QuestionScreen.tsx:85-89).resolveTextpasses a plain-string prompt through unchanged.Buttonwhose text sits in nested spans, witharia-hiddenicons and noaria-pressed(QuestionScreen.tsx:102-131).QuestionScreen.tsx:71,105).FeedbackPanelrenders arole="status"aria-live="polite"banner (FeedbackPanel.tsx:34-36) and anautoFocusbutton. That button reads "Next", or "See how I did!" on the last question (FeedbackPanel.tsx:67-76;src/locales/en/common.json:1084,1098).QuestionScreen.test.tsx:52(AC-3.1, labelled group) and:135-148(AC-3.3, noaria-pressed).FeedbackPanel.test.tsx:18(AC-1.2, status region) and:61(AC-1.4, auto-focus).K2InstantFeedbackQuiz.test.tsx:409-421(status region) and:423-435(focus).ActivityPlayerQuizGate.test.tsx:170-184,233-257,288-301checks that ak2student gets the instant quiz, but only bydata-testid="instant-quiz", with no accessibility assertion.ActivityPlayerA11y.test.tsxchecks only theg3_5legacy list quiz, whose contract includesaria-pressed(ActivityPlayerA11y.test.tsx:104-115;LegacyListQuiz.tsx:63-67,75-96). After test(a11y): un-quarantine the GameShell and ActivityPlayer accessibility suites (#951) #952 itsbeforeEachpinsgetStudentCoursestog3_5.Issue
Harness issue #162 (jgoetzmann/bright-bots-harness#162) is a
/harness workrequest with no product issue. It follows up Bright Boost #952 and was the first open question in proposal #90. It asks for one narrowly scoped, page-level K-2 accessibility test for the ActivityPlayer quiz. The test stubs a K-2 course list soK2InstantFeedbackQuizmounts, then checks four things:role="status"feedback and moves focus to the feedback panel's Next button.aria-pressed(AC-3.3).The request also sets these limits:
g3_5case inActivityPlayerA11y.test.tsxstays unchanged.The plan is checked against Bright Boost
mainat1a2437d. On that commitActivityPlayerA11y.test.tsxis still quarantined (describe.skipat line 68). #952 un-quarantines it and pins it tog3_5, so this item waits for #952.Approach
Wait for test(a11y): un-quarantine the GameShell and ActivityPlayer accessibility suites (#951) #952 (harness item Fix dbtest endpoint module syntax for Azure Functions compatibility #90) and Create Profile.tsx #161 to merge. Then work in
ActivityPlayerA11y.test.tsxas test(a11y): un-quarantine the GameShell and ActivityPlayer accessibility suites (#951) #952 leaves it.Add a second top-level
describe("ActivityPlayer Accessibility — K-2 instant quiz", ...)beside the existing one. Leave the existingdescribeand itsitbyte-identical.Give the new
describeits ownbeforeEach, mirroring test(a11y): un-quarantine the GameShell and ActivityPlayer accessibility suites (#951) #952's:vi.resetAllMocks(),__resetGradeBandCache()andlocalStorage.clear();api.getStudentCoursesto[{ gradeBand: "k2" }]. That makes the K-2 intent explicit, thoughk2is also the fallback;api.getModuleto a module whose activitya-1is astory_quizwith one slide and two questions. With two questions, the first feedback button reads "Next".Add one
itthat:data-testid="instant-quiz";getByRole("group", { name: <first prompt> });within(group).getByRole("button", { name: <text> })exists and has noaria-pressedattribute;role="status"element witharia-live="polite", and thatgetByRole("button", { name: "Next" })has focus;aria-pressed, now in the feedback phase.Do not answer the last question or finish the quiz. Completion is covered elsewhere, and finishing would add a
completeActivitycall this test does not need.Two-phase proof, with nothing committed. First run the file and record it green, with 2 passed and 0 skipped. Then make each temporary break below on its own, run the file, record the failing assertion, and revert:
aria-pressed={false}to theQuestionScreenchoiceButton. Step 5 fails.aria-pressed={phase === "feedback" ? origIdx === selectedChoiceIndex : undefined}instead. Only step 8 fails.aria-labelledbyfrom the group. Step 4 fails.aria-live="polite"fromFeedbackPanel. Step 7 fails on the live region.autoFocusfromFeedbackPanel. Step 7 fails on focus.End by showing the file green again.
Risks
ActivityPlayer.tsx:820-831), and the toast is mocked, but the implementer should confirmgetByRolefinds exactly one.enMockdoes not interpolate, so "Question {{current}} of {{total}}" renders with its placeholders (common.json:1095). The case must not assert on that text. Item Create Profile.tsx #163 is the place to change it.1a2437d, and test(a11y): un-quarantine the GameShell and ActivityPlayer accessibility suites (#951) #952's version of the test file must be re-read at implementation time.Gate results — this repository's own sequence, run on the branch
b63535497587d39cfea6e6c15ead45dda2e7295aharness/fix-162-add-one-narrowly-scoped-k-2-page-level-aprepare: npm ciprepare: backend npm cinpx prisma generatenpm run lintnpm run typecheckbackend: npm run typecheckbash scripts/check-prisma-drift.shnpm run test:unitnpm run buildnpx prisma generatenpm run lintnpm run typecheckbackend: npm run typecheckbash scripts/check-prisma-drift.shnpm run test:unitnpm run buildEvery gate passed. The verbatim output of each is in the review package (
EVIDENCE.md), attached to the run and rebuildable with the commands below.Self-audit at
9d0204bd8cdd: no blocking findings, 1 note.Every finding, notes included, is in the review package's
DECISIONS.md.The review package, verbatim
Review package — test(a11y): cover the K-2 instant quiz in the ActivityPlayer accessibility suite
Work item 162 (
request:ee0d6b33b567) onBright-Bots-Initiative/brightboost.Produced by bright-bots-harness 1.0.0 on the
clibackendat 2026-11-18T03:06:11Z.
What this is
A change proposed by an automated harness running at permission tier 2. It holds one
credential, belonging to a machine account that owns
jgoetzmann-bot/brightboost. It pushes this branchto that fork and opens the pull request from there; it never pushes to
Bright-Bots-Initiative/brightboostitself, and it can neither merge a pull request nor act on a review (I-12). It never
publishes a change under
.github/(I-15). That is the harness's own check, not alimit of the credential: it refuses to push any commit of its own that touches
.github/. It is yours to accept, amend, or discard; merging it is a human action.What changed
b63535497587d39cfea6e6c15ead45dda2e7295aharness/fix-162-add-one-narrowly-scoped-k-2-page-level-apatches/0001-test-a11y-cover-the-K-2-instant-quiz-in-the-Activity.patchsrc/pages/__tests__/ActivityPlayerA11y.test.tsxHow to verify
Reconstruct the exact tree the harness had. This needs nothing but this directory
and the public product repository:
Or fetch the branch straight out of the bundle, with no network at all:
Then read
EVIDENCE.md, which carries the verbatim output of the repository's owngate sequence, baseline and post-change, with exit codes.
What is in here
README.mdDIAGNOSIS.mdDECISIONS.mdEVIDENCE.mdACCEPTANCE.mdBASEmanifest.jsonpatches/BASEbundle.gitbundletranscript.jsonlRebuild this exact tree yourself
Base commit
b63535497587d39cfea6e6c15ead45dda2e7295aexists here inBright-Bots-Initiative/brightboost; the branchharness/fix-162-add-one-narrowly-scoped-k-2-page-level-aonjgoetzmann-bot/brightboostwas rebased onto the fork's main, which is a fast-forward of this repository (B105).With the review package on disk instead (
docs/PACKAGE-FORMAT.md§3):Or from the bundle, with no network at all:
About the harness
Posted by the Bright Bots Harness, an automated agent that turns issues on
Bright-Bots-Initiative/brightboostinto reviewable pull requests.It never merges anything: a person approves the plan by merging the proposal, and the change by merging the delivery. A committed kill switch stops it.
Where things are. Start here · Every command · What it will and will not do · When something is wrong · What is in a review package
Repositories. harness
jgoetzmann/bright-bots-harness· forkjgoetzmann-bot/brightboost· productBright-Bots-Initiative/brightboost