Skip to content

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

Merged
merged 8 commits into from
May 17, 2021
Merged

Conversation

MattAgn
Copy link
Collaborator

@MattAgn MattAgn commented Feb 7, 2021

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

@MattAgn MattAgn changed the title test: extract byText related tests Extract tests by query types Feb 7, 2021
@MattAgn MattAgn changed the title Extract tests by query types Extract tests by queries Feb 7, 2021
@MattAgn
Copy link
Collaborator Author

MattAgn commented Mar 11, 2021

@thymikee are those tests ok for you? is it the kind of refactor you had in mind?

@thymikee
Copy link
Member

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 :)

@MattAgn
Copy link
Collaborator Author

MattAgn commented Mar 12, 2021

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);
Copy link
Contributor

@ice-chillios ice-chillios May 17, 2021

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.

Copy link
Member

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

Copy link
Member

@thymikee thymikee left a 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

@thymikee thymikee merged commit ffda1de into callstack:master May 17, 2021
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