Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest version of jsdom (15.2.0) causes focus test to fail #145

Closed
pwolaq opened this issue Oct 24, 2019 · 2 comments · Fixed by #147
Closed

latest version of jsdom (15.2.0) causes focus test to fail #145

pwolaq opened this issue Oct 24, 2019 · 2 comments · Fixed by #147
Labels

Comments

@pwolaq
Copy link
Contributor

pwolaq commented Oct 24, 2019

  • @testing-library/jest-dom version: 4.1.2
  • node version: 12.6.0
  • npm (or yarn) version: 6.11.3

Relevant code or config:

...

What you did:

npm run setup

What happened:

[test] 
 FAIL  src/__tests__/to-have-focus.js
  ● .toHaveFocus
[test] 
    expect(element).toHaveFocus()
[test] 
    Expected
      <input id="focused" type="text" />
[test]     Received:
      null
[test] 
      14 |   focused.focus()
      15 | 
    > 16 |   expect(focused).toHaveFocus()
         |                   ^
      17 |   expect(notFocused).not.toHaveFocus()
      18 | 
      19 |   expect(() => expect(focused).not.toHaveFocus()).toThrowError()

      at Object.toHaveFocus (src/__tests__/to-have-focus.js:16:19)
[test] 
[test] 
[test] Test Suites: 2 failed, 32 passed, 34 total
[test] Tests:       2 failed, 126 passed, 128 total
[test] Snapshots:   8 passed, 8 total

Reproduction:

Problem description:

Suggested solution:

@pwolaq
Copy link
Contributor Author

pwolaq commented Oct 24, 2019

Ok so I did some research and breaking change was introduced by this line: jsdom/jsdom@0371215...b4bb1c5#diff-0cd62b5fc481017f758f31a7be9cdd5eR12

this is pointing to document, however getRoot returns div

@gnapse
Copy link
Member

gnapse commented Nov 1, 2019

🎉 This issue has been resolved in version 4.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gnapse gnapse added the released label Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants