Skip to content
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

Add brackets ([]{}) to defaultKeyMap for keyboard()/type() #1226

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

bawjensen
Copy link
Contributor

What:

Adding support for brackets to address #1225

Why:

To allow easier testing of functionality that relies on both key and code being valid for keyboard events involving left/right brackets

How:

Updated keyMap.ts, ran the test suite.

Checklist:

  • [N/A] Documentation
  • Tests
  • Ready to be merged

I'm unclear whether any documentation needs updating, since I imagine this just falls under the heading of the TODO at the bottom of keyMap.ts, i.e. this is simply filling out the mappings.

Also I considered the updates to the existing tests enough, but it's possibly I ought to add more test cases (namely for the right bracket cases).

Copy link

codesandbox-ci bot commented Jun 18, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@ph-fritsche ph-fritsche merged commit 543ecb0 into testing-library:main Jan 21, 2025
3 checks passed
Copy link

🎉 This PR is included in version 14.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

userEvent.keyboard(']') results in {key: ']', code: 'Unknown'}
3 participants