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

Add ability to select title element of SVG with getByTitle #86

Merged
merged 2 commits into from
Aug 9, 2018

Conversation

wyze
Copy link
Collaborator

@wyze wyze commented Aug 9, 2018

Close #83

What: Add ability to select title element of SVG with getByTitle

Why: The title element of an SVG behaves the same as a title attribute on other elements, so the getByTitle query should find that element.

How: Update queryAllByTitle function to check for [title] or svg > title selectors and use either one that is returned for the match.

Checklist:

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

kentcdodds
kentcdodds previously approved these changes Aug 9, 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.

Excellent! Thank you 👍

text,
{exact = true, collapseWhitespace = true, trim = true} = {},
) {
const matcher = exact ? matches : fuzzyMatches
Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing this is where we're missing some coverage. Could you add one more assertion that specifies exact: false to cover this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure thing. Will get that pushed up shortly.

@kentcdodds
Copy link
Member

Thanks so much for your help! I've added you as a collaborator on the project. Please make sure that you review the other/MAINTAINING.md and CONTRIBUTING.md files (specifically the bit about the commit messages and the git hooks) and familiarize yourself with the code of conduct (we're using the contributor covenant). You might also want to watch the repo to be notified when someone files an issue/PR. Please continue to make PRs as you feel the need (you can make your branches directly on the repo rather than your fork if you want). Thanks! And welcome to the team :)

@kentcdodds kentcdodds merged commit fe44799 into testing-library:master Aug 9, 2018
@kentcdodds
Copy link
Member

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@wyze wyze deleted the svg-title-element branch August 9, 2018 14:23
alexkrolick pushed a commit to alexkrolick/dom-testing-library that referenced this pull request Sep 13, 2018
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.

2 participants