jest-native icon indicating copy to clipboard operation
jest-native copied to clipboard

Add a way to test Modal components

Open Goldziher opened this issue 5 years ago • 2 comments

Hi,

Its very difficult to test the Modal component in RN directly at present. It would be awesome if:

  1. there is some way to directly select the modal element
  2. 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.

Goldziher avatar Oct 29 '20 10:10 Goldziher

👋 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.

fluiddot avatar Jan 24 '22 18:01 fluiddot

👋 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.

After applying some updates, the PR is now ready to be reviewed 🎊 .

fluiddot avatar Jan 25 '22 11:01 fluiddot

Resolved by #73

mdjastrzebski avatar Oct 20 '22 20:10 mdjastrzebski