-
Notifications
You must be signed in to change notification settings - Fork 273
Extract tests by queries #666
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
@thymikee are those tests ok for you? is it the kind of refactor you had in mind? |
Yup, but since this touches tests, I need to take a double care in verifying we don't miss any use cases we covered. Struggling to find time at the moment, but will get there :) |
Sure, totally understand! Tell me if I can be of any help :) |
|
||
test('getByDisplayValue, queryByDisplayValue', () => { | ||
const { getByDisplayValue, queryByDisplayValue } = render(<Banana />); | ||
const input = getByDisplayValue(/custom/i); |
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.
You could place that regex and the next ones at the top similar to texts with a proper name. It would be consistent and helpful for future readings.
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.
Feel free to address that as a followup
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.
Thanks @dsznajder for the review
Summary
This PR is the follow up of this PR and this PR addressing this issue.
Its purpose is to re-organize the tests of the queries byDisplayValue, byTestId, byText and byPlaceholderText and have them each in a separate file (for now they all are in the findByApi.test.js and render.test.js files) .
Test plan
Tests should not change and only be moved to the proper query files