Skip to content

fix: getByLabelText for output #789

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

Merged

Conversation

marcosvega91
Copy link
Member

What: I have fixed #787 and the comment in #343 (comment)

Why: Because following specs it should be possible to get output by it's label.

How: Instead of replacing string that could cause the issue in the comment #343 (comment) I have looped al the childNodes taking text only from the right nodes

Checklist:

  • Documentation added to the
    docs site
  • Tests
  • Typescript definitions updated
  • Ready to be merged

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 15, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 37f1c76:

Sandbox Source
kentcdodds/react-testing-library-examples Configuration
react-testing-library demo Issue #787

@codecov
Copy link

codecov bot commented Oct 15, 2020

Codecov Report

Merging #789 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #789   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines          725       725           
  Branches       188       190    +2     
=========================================
  Hits           725       725           
Impacted Files Coverage Δ
src/get-node-text.js 100.00% <100.00%> (ø)
src/helpers.js 100.00% <100.00%> (ø)
src/queries/label-text.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53829b8...37f1c76. Read the comment docs.

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@kentcdodds kentcdodds merged commit bc65b91 into testing-library:master Oct 19, 2020
@testing-library-bot
Copy link

🎉 This PR is included in version 7.26.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ByLabelText does not work properly with output element
5 participants