-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEI-5533: Re-enable select keyboard tests for Dropdown and Clickable #2420
base: main
Are you sure you want to change the base?
Conversation
userEvent@14 changed how keyboard events are handled, so they were failing to match things like `" "` or `32` for space key codes. `keyboard('{space}')` passes back a case-sensitive event name that must be matched specifically, like "Space" or "space". To make this work in ClickableBehavior, I centralized the keys into wonder-blocks-core so it could be reused in Dropdowns and elsewhere. I also included a story with one of the unit test fixtures so I could compare headless testing to the browser.
🦋 Changeset detectedLatest commit: 631850f The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
npm Snapshot: Published🎉 Good news!! We've packaged up the latest commit from this PR (63b2d0f) and published all packages with changesets to npm. You can install the packages in webapp by running: ./services/static/dev/tools/deploy_wonder_blocks.js --tag="PR2420" Packages can also be installed manually by running: yarn add @khanacademy/wonder-blocks-<package-name>@PR2420 |
A new build was pushed to Chromatic! 🚀https://5e1bf4b385e3fb0020b7073c-qfjwerghlt.chromatic.com/ Chromatic results:
|
Size Change: +96 B (+0.1%) Total Size: 96.5 kB
ℹ️ View Unchanged
|
In working on WB-1799 for SingleSelect, I found a bunch of disabled tests that I started fixing to ensure keyboard interactions work. Fixing these tests required changes to Clickable, which is used in WB Dropdowns.
Jira issue: https://khanacademy.atlassian.net/browse/FEI-5533
PR highlights:
userEvent@14
keys
object inwonder-blocks-core
for use inwonder-blocks-clickable
,wonder-blocks-dropdown
, and any other modules that need it.Space
orspace
. I lower-cased the key names to make sure they match in the code. We could use linting to enforce this instead... I'm open to suggestions.Test Plan
Run the tests using
yarn test
.There is one pre-existing lint failure for me locally in
expect-render-error.d.ts
, but it seems unrelated to these changes.