You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 30, 2020. It is now read-only.
onLayout is a prop supported by TouchableOpacity so it'd be good to be able to verify that my component called it's onLayout handler that I pass to it when a layout event is triggered.
react-nativeorexpo: Exponative-testing-libraryversion: 5.0.3jest-preset:@testing-library/react-nativereact-nativeversion: Expo 38 / RN 0.62nodeversion: 14Relevant code or config:
What you did:
Tried to test the
onLayoutfunctionality of a component that uses TouchableOpacity.What happened:
Mocked onLayout handler was never called.
I had followed https://stackoverflow.com/questions/57961440/testing-onlayout-in-react-native/61774123#61774123 which suggested that it should work and on testing a
Viewbased component like in the example it worked, however on changing theViewtoTouchableOpacityit no longer worked.Reproduction:
See attached test cases.
Problem description:
onLayoutis a prop supported byTouchableOpacityso it'd be good to be able to verify that my component called it'sonLayouthandler that I pass to it when a layout event is triggered.