Skip to content

tests: fuzz the trainSecondKey guided lesson option - #628

Open
jpds wants to merge 6 commits into
aradzie:masterfrom
jpds:test/train-second-key-e2e-fuzz
Open

tests: fuzz the trainSecondKey guided lesson option #628
jpds wants to merge 6 commits into
aradzie:masterfrom
jpds:test/train-second-key-e2e-fuzz

Conversation

@jpds

@jpds jpds commented Jul 31, 2026

Copy link
Copy Markdown

Created this on top of #627 and #623 to fully validate the change.

jpds added 6 commits July 31, 2026 19:12
Simulates a human typing through the full American English alphabet in the
guided lesson with a randomized per-round typing speed, checking that keys
never regress, unlock one at a time, and that the target key, its toast, and its
confidence state stay consistent throughout.

Others included tests cover the toasts, the on-screen keyboard's
hesitation-pointer highlighting the physically correct key, and a
mistyped-then-corrected character rendering in the theme's miss color.
Writes new guided-lesson settings to `localStorage` and reloads mid-run.
This checks progress survives the `GuidedLesson`/`Progress` reconstruction:

* `naturalWords` and a target-speed ramp shouldn't lose already-earned unlocks
* `alphabetSize` can force-include several keys in one round
* `recoverKeys` can legitimately re-lock a key past the guaranteed first 6.
Occasionally mistypes-then-corrects the displayed character instead of
typing it cleanly, mirroring a human fumble.
Adds lesson.guided.trainSecondKey: previews and unlocks a second key
alongside the primary focus, one letter at a time.
Solid outline in --accent, distinct from the focused key's
--secondary-l2.
Adds e2e tests for lesson.guided.trainSecondKey covering the full
alphabet unlock, the second-focused key, and toggling the setting
mid-run.
@semanticdiff-com

semanticdiff-com Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  package.json  40% smaller
  packages/keybr-lesson/lib/text/words.test.ts  20% smaller
  packages/keybr-lesson/lib/fakes.ts  14% smaller
  packages/keybr-lesson/lib/guided.ts  11% smaller
  packages/keybr-lesson/lib/guided.test.ts  1% smaller
  .gitignore Unsupported file format
  e2e/guided-lesson/alphabet-size-churn.spec.ts  0% smaller
  e2e/guided-lesson/alphabet-unlock.spec.ts  0% smaller
  e2e/guided-lesson/daily-goal-toast.spec.ts  0% smaller
  e2e/guided-lesson/helpers.ts  0% smaller
  e2e/guided-lesson/mistake-color.spec.ts  0% smaller
  e2e/guided-lesson/pointer-highlight.spec.ts  0% smaller
  e2e/guided-lesson/recover-keys-churn.spec.ts  0% smaller
  e2e/guided-lesson/settings-churn.spec.ts  0% smaller
  e2e/guided-lesson/train-second-key-churn.spec.ts  0% smaller
  e2e/guided-lesson/train-second-key.spec.ts  0% smaller
  e2e/smoke.spec.ts  0% smaller
  package-lock.json  0% smaller
  packages/keybr-lesson-ui/lib/Key.test.tsx  0% smaller
  packages/keybr-lesson-ui/lib/Key.tsx  0% smaller
  packages/keybr-lesson-ui/lib/KeyLegend.test.tsx  0% smaller
  packages/keybr-lesson-ui/lib/KeyLegend.tsx  0% smaller
  packages/keybr-lesson-ui/lib/KeyLegendList.tsx  0% smaller
  packages/keybr-lesson-ui/lib/styles.module.less Unsupported file format
  packages/keybr-lesson/lib/confirmed-unlocks.ts  0% smaller
  packages/keybr-lesson/lib/key.test.ts  0% smaller
  packages/keybr-lesson/lib/key.ts  0% smaller
  packages/keybr-lesson/lib/settings.ts  0% smaller
  packages/keybr-lesson/lib/text/words.ts  0% smaller
  packages/keybr-theme-designer/lib/design/LessonKeysPreview.tsx  0% smaller
  packages/keybr-themes/lib/themes/theme.less Unsupported file format
  packages/page-practice/lib/settings/lesson/GuidedLessonSettings.tsx  0% smaller
  packages/page-practice/lib/settings/lesson/TrainSecondKeyProp.tsx  0% smaller
  playwright.config.ts  0% smaller

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