Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: testing-library/dom-testing-library
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.26.4
Choose a base ref
...
head repository: testing-library/dom-testing-library
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.26.5
Choose a head ref
  • 2 commits
  • 5 files changed
  • 2 contributors

Commits on Nov 3, 2020

  1. fix: null labels on hidden inputs (#804)

    * Ensure hidden inputs are not labelable
    
    The `labels` property on `input` elements of type `hidden` is `null`
    rather than `NodeList` [1]. This meant the `getRealLabels` function
    would return `null` causing `queryAllByLabelText` to throw an error when
    it tried to call `length` on `null` [2].
    
    This commit fixes the issue by ensuring the element is labelable before
    calling `labels` on it, and adds a test case for this specific scenario.
    
    [1]: https://html.spec.whatwg.org/multipage/forms.html#dom-lfe-labels
    [2]: https://github.com/testing-library/dom-testing-library/blob/62f4e5e09a4b81ef66679560b540523edccdef98/src/queries/label-text.js#L52
    
    * squash! Ensure hidden inputs are not labelable
    
    This commit fixes the issue by retuning an empty array if the `labels`
    property is `null`, and adds a test case for this specific scenario.
    thomasmarshall authored Nov 3, 2020
    Configuration menu
    Copy the full SHA
    6ef63b7 View commit details
    Browse the repository at this point in the history
  2. docs: add thomasmarshall as a contributor (#807)

    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Nov 3, 2020
    Configuration menu
    Copy the full SHA
    b5731ba View commit details
    Browse the repository at this point in the history
Loading