question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

  1. Use CRA to create new app
  2. 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",
  1. Create a component with textbox input, I just pasted in the input event example from https://testing-library.com/docs/example-input-event
  2. Use user.type instead of fireEvent to fill the input
  3. 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
kentcdoddscommented, Jun 5, 2020

I figured it out. Pushing a fix in a moment.

0reactions
kelvinlzhangcommented, Jun 5, 2020

What tpict said, thanks @kentcdodds! 🚀

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found