Skip to content
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

Feature - Add queries for dom attriburte role #94

Merged
merged 2 commits into from
Sep 4, 2018

Conversation

JeffBaumgardt
Copy link
Contributor

@JeffBaumgardt JeffBaumgardt commented Sep 4, 2018

What: Add queries for role dom attribute

Why: As evidenced by gnapse/jest-dom#55 having a role attribute query would be helpful when attempting to get elements that don't fit the other queries.

My example was a dialog who did not have any other matching queries and due to the associated library. I was able to add data-testid but that added the attribute too low in the generated dom not to the container root as expected, this is a problem with the library not dom-testing-library.

How: I added new query selectors for the node attribute.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

@JeffBaumgardt
Copy link
Contributor Author

This resolves #93

kentcdodds
kentcdodds previously approved these changes Sep 4, 2018
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.

Looks super! Just a few things. Thanks!

README.md Outdated Show resolved Hide resolved
src/__tests__/element-queries.js Outdated Show resolved Hide resolved
src/__tests__/element-queries.js Outdated Show resolved Hide resolved
@kentcdodds
Copy link
Member

Just noticed that the commit is attributed to jbaumgardt (probably due to your local git config). Just thought I'd mention it in case that's a mistake.

@JeffBaumgardt
Copy link
Contributor Author

Yeah my git config is all messed up. I need to wipe it and start over :)

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.

Perfect. Thanks!

@kentcdodds kentcdodds merged commit fe02135 into testing-library:master Sep 4, 2018
@kentcdodds
Copy link
Member

🎉 This PR is included in version 3.5.0 🎉

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants