Skip to content

Latest release (3.18.1) breaks labels with nested spans #230

@NehrDani

Description

@NehrDani
  • dom-testing-library version: 3.18.1
  • react version: 1.18.4
  • node version: 10.15.2
  • npm (or yarn) version: yarn 1.15.2

Relevant code or config:

<div>
  <input id="some-id" />
  <label htmlFor="some-id">
    <span>Some Input</span>
  </label>
</div>

What you did:

Just installed react-testing-library after cleaning up my node_modules.

What happened:

All Tests using getLabelById with nested spans are failing.

Reproduction:

https://codesandbox.io/s/0ym9qxzlmp

Problem description:

Recently working tests are now failing without changes in the code or the tests.
Already mentioned here: #190 (comment)

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