Dom-testing-library: Latest release (3.18.1) breaks labels with nested spans

Created on 20 Mar 2019  路  2Comments  路  Source: testing-library/dom-testing-library

  • 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: https://github.com/kentcdodds/dom-testing-library/pull/190#issuecomment-474642984

Suggested solution:

released

Most helpful comment

Honestly, I think the new behavior is problematic and probably never what we want. So I'm going to just revert it.

All 2 comments

Honestly, I think the new behavior is problematic and probably never what we want. So I'm going to just revert it.

:tada: This issue has been resolved in version 3.18.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings