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

feat(prefer-presence-queries): support react-native matcher toBeOnTheScreen #844

Merged
merged 1 commit into from Nov 21, 2023

Conversation

retyui
Copy link
Contributor

@retyui retyui commented Nov 17, 2023

Checks

Changes

React Native Testing Library recommend to use this eslint plugin: https://callstack.github.io/react-native-testing-library/docs/eslint-plugin-testing-library
React Native Testing Library has custom matchers: https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeonthescreen

this PR adding support for support for that matsher toBeOnTheScreen

expect(screen.queryByText('button')).toBeOnTheScreen(); // No error :(

expect(screen.queryByText('button')).toBeInTheDocument(); // Error: testing-library/prefer-presence-queries

Context

...

Copy link
Member

@Belco90 Belco90 left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. Can you add some valid and invalid tests, please? Thanks.

…om react-native matcher `toBeOnTheScreen`s

Signed-off-by: Davyd NRB <4661784+retyui@users.noreply.github.com>
@retyui
Copy link
Contributor Author

retyui commented Nov 17, 2023

Thanks for your contribution. Can you add some valid and invalid tests, please? Thanks.

ready

@retyui retyui requested a review from Belco90 November 17, 2023 19:21
@Belco90 Belco90 changed the title Update testing-library/prefer-presence-queries rule to support custom react-native matcher toBeOnTheScreen feat(prefer-presence-queries): support react-native matcher toBeOnTheScreen Nov 21, 2023
@Belco90 Belco90 added the enhancement New feature or request label Nov 21, 2023
@Belco90 Belco90 merged commit b9fef59 into testing-library:main Nov 21, 2023
29 checks passed
Copy link

🎉 This PR is included in version 6.2.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
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants