testing-library / testing-library/user-event
type/keyboard modifier key not working as described in the docs
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 258
- PR merge metrics
- No merged PRs in 30d
Description
Reproduction example
https://codesandbox.io/s/user-event-modifiers-not-working-78eg54?file=/src/App.test.js
Prerequisites
render(<input />);
const input = screen.getByRole("textbox");
await userEvent.type(input, "{Shift>}a{/Shift}");
expect(input.value).toBe("A");
Expected behavior
Input value should be A (uppercase) if I understand the docs correctly
Actual behavior
Input value is a (lowercase)
User-event version
14.4.3
Environment
Testing Library framework: @testing-library/react@14.0.0
JS framework: react@18.2.0
Test environment: jest@29.5.0
DOM implementation: jsdom@20.0.3
Additional context
No response
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 with the reproduction in the linked CodeSandbox, particularly /src/App.test.js, and run the example using user-event 14.4.3. Trace the modifier-key behavior until the source of the lowercase result is clear; done means the documented {Shift>}a{/Shift} interaction produces an uppercase A.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100