-
Notifications
You must be signed in to change notification settings - Fork 468
Add within API #53 #54
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
Conversation
There was a problem hiding this 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 simple changes. Thanks!
README.md
Outdated
| Example: To get the text 'hello' only within a section called 'messages', you could do: | ||
|
|
||
| ```javascript | ||
| import {render, within} from 'react-testing-library' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change this example to work better in the dom-testing-library docs?
import {within} from 'dom-testing-library'
const {getByText} = within(document.body.getElementById('messages'))
const helloMessage = getByText('hello')Also, could you add a note that says:
> Fun fact, this is actually just an alias to the `getQueriesForElement` function!
src/index.js
Outdated
| export * from './pretty-dom' | ||
|
|
||
| // The original name of bindElementToQueries was weird | ||
| // The new name is better. Remove this in the next major version bump. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move these two comments to right above the bindElementsToQueries export? That's where the comment applies. We'll keep the within alias indefinitely.
| }, | ||
| { | ||
| "login": "Dajust", | ||
| "name": "Justice Mba ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an extra space after your name, typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, I think that file is auto-generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
🎉 This PR is included in version 2.6.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |

What: Add a
withinAPIWhy: Kindly see #53
How: Exported
getQueriesForElementaswithinfrom the index.js fileChecklist: