Skip to content

Issue 707- getByLabelText does not work with some IDs when using aria-labelledby #708

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
merged 1 commit into from
Jul 20, 2020

Conversation

ryuuji3
Copy link
Contributor

@ryuuji3 ryuuji3 commented Jul 20, 2020

What: When using aria-labelledby, getByLabelText should account for a selector that might need quotes around it.

Why: In such a case, the selector is invalid causing unexpected test failures

How: Just a one line change to wrap quotes around the id in the selector.

Checklist:

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

Closes #707

@codesandbox-ci
Copy link

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 2bb60d8:

Sandbox Source
kentcdodds/react-testing-library-examples Configuration

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.

Rock solid. Thank you!

@kentcdodds kentcdodds merged commit 395d5c5 into testing-library:master Jul 20, 2020
@kentcdodds
Copy link
Member

@all-contributors please add @ryuuji3 for code and tests

@allcontributors
Copy link
Contributor

@kentcdodds

I've put up a pull request to add @ryuuji3! 🎉

@kentcdodds
Copy link
Member

🎉 This PR is included in version 7.21.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ryuuji3
Copy link
Contributor Author

ryuuji3 commented Jul 20, 2020

Sweet, thank you very much!

@ryuuji3 ryuuji3 deleted the pr/iss-707 branch July 21, 2020 03:55
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.

getByLabelText does not work with some IDs
2 participants