Conversation
suany0805
left a comment
There was a problem hiding this comment.
Nice work @kdquistanchala !
JoseLion
left a comment
There was a problem hiding this comment.
Looks good so far. I left a few comments. Let me know if you have any questions 🙂
| } | ||
|
|
||
| return ( | ||
| parentElement.findAll( |
There was a problem hiding this comment.
You can use the .some() method instead of finding all elements and then checking if the length is > 0 🙂
There was a problem hiding this comment.
@JoseLion .some does not exist on ReactInstance class. It is not an array
| <View testID="grandParentId"> | ||
| <View testID="parentId"> | ||
| <View testID="childId" /> | ||
| </View> | ||
| <Text testID="textId" /> | ||
| </View>, |
There was a problem hiding this comment.
Can we use <Text> elements so that we can avoid the testIDs?
There was a problem hiding this comment.
Im trying to do this, but im not getting good results, would you like to pair?
| describe (".toContainElement", () => { | ||
| const element = render( |
There was a problem hiding this comment.
As a good practice, elements should be rendered on each test it(..) function, so the cleanup function cleans what's rendered before each test, avoid flaky tests, etc.
35e5052 to
82fa78b
Compare
1942629 to
4194055
Compare
4cfe69c to
dcded59
Compare
4194055 to
392d9c6
Compare
# Conflicts: # packages/native/src/lib/ElementAssertion.ts
560250d to
a560a05
Compare
This PR adds the
toContainElement()matcher for React Native