jest-native
jest-native copied to clipboard
Add a way to test Modal components
Hi,
Its very difficult to test the Modal component in RN directly at present. It would be awesome if:
- there is some way to directly select the modal element
- check if the modal "visible" prop is in place, i.e. use a matcher like "toBeVisible()"
If not 1 & 2, it would be great if we could check if components within a modal are in fact visible or not.
👋 I'd like to share that I'm working on adding the toBeVisible matcher in this PR following a similar logic as the same jest-dom matcher (reference). I think this matcher would be useful for covering cases like the one described above by @Goldziher, in order to check the visibility of the Modal component.
👋 I'd like to share that I'm working on adding the
toBeVisiblematcher in this PR following a similar logic as the samejest-dommatcher (reference). I think this matcher would be useful for covering cases like the one described above by @Goldziher, in order to check the visibility of theModalcomponent.
After applying some updates, the PR is now ready to be reviewed 🎊 .
Resolved by #73