Skip to content

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

@pwolaq

Description

@pwolaq
  • @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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions