Upgrade to v11.1.0 causes type method to fill Input incorrectly
See original GitHub issue@testing-library/user-event
version: 11.1.0- Testing Framework and version: jest on fresh react-scripts@3.4.1 app
- DOM Environment: jest-environment-jsdom-sixteen@1.0.3
STR:
- Use CRA to create new app
- Make the following upgrades:
"@testing-library/jest-dom": "5.9.0",
"@testing-library/react": "^10.2.0",
"@testing-library/user-event": "^11.0.0", ----> "11.1.0" // breaking
"jest-environment-jsdom-sixteen": "^1.0.3",
- Create a component with textbox input, I just pasted in the input event example from https://testing-library.com/docs/example-input-event
- Use
user.type
instead offireEvent
to fill the input - Run test with
--env=jest-environment-jsdom-sixteen
and observe that it fails
What happened:
test('It should keep a $ in front of the input', async () => {
const { input } = setup()
await user.type(input, "23")
expect(input.value).toBe('$23')
})
Expected: "$23"
Received: "$32"
Reproduction repository: https://github.com/kelvinlzhang/user-event-test
Problem description: type
fails to fill the input correctly. If you downgrade to 11.0.0 the test will pass. On another repo this exact upgrade causes an InvalidStateError
and I had to reinstall jest-environment-jsdom-sixteen. This comment, https://github.com/testing-library/user-event/issues/307#issuecomment-639222058, also explains another issue I have been unable to reproduce on a fresh app but occurred with the same dependencies.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (7 by maintainers)
Top Results From Across the Web
ETSI TS 124 011 V11.1.0 (2012-10)
The present document may be made available in more than one electronic version or in print. In any case of existing or perceived...
Read more >Fix list for IBM App Connect Enterprise Version 11.0
The following is a complete listing of available fixes for IBM App Connect Enterprise Version 11.0 on all supported platforms.
Read more >Manually upgrading your Linksys Wi-Fi Router's firmware
IMPORTANT: Do NOT turn OFF the power or press the reset button of the router during the upgrade process. User-added image. If you...
Read more >Upgrading from AngularJS to Angular
It is possible to prepare and align AngularJS applications with Angular even before beginning the upgrade process. These preparation steps are all about ......
Read more >NetWitness Platform Known Issues - 571872
Components Found In / Exists In Tracking Number
Endpoint 12.1 ASOC‑125096
Source Server 12.1 SADOCS‑124473
Health & Wellness 11.5.x, 11.6.x 11.7.1.x, 12.0.x SADOCS‑2330
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I figured it out. Pushing a fix in a moment.
What tpict said, thanks @kentcdodds! 🚀