testing-library / testing-library/user-event
feat: skip special character parsing
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 258
- PR merge metrics
- No merged PRs in 30d
Description
@ph-fritsche Maybe add an option to skip detection of key descriptors? Something like:
userEvent.type(input, '{"foo":"bar"}', { skipSpecialCharacters: true })
Originally posted by @lynxtaa in https://github.com/testing-library/user-event/issues/584#issuecomment-800922956
An alternative might be to export this workaround as a utility:
userEvent.type(input, '{"foo":"bar"}'.replace(/[{[]/g, '$&$&'))
// would become
userEvent.type(input, escapeKeyboardInput('{"foo":"bar"}'))
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing key-descriptor parsing entry point and the behavior shown in the issue examples. Decide whether the feature should be an option or an escape utility, then verify that JSON-like input is typed without special-character parsing and that the chosen API is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100