testing-library / testing-library/user-event

feat: skip special character parsing

Open
#586 4 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.