-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Handle testID prop
#3838
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
base: next
Are you sure you want to change the base?
Handle testID prop
#3838
Conversation
| if (key === 'testID') { | ||
| res.gestureHandlerProps[key] = props[key]; | ||
| // @ts-ignore FIXME(TS) | ||
| res.childProps[key] = props[key]; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is to use the same testID for both, component and gesture. This way, it is possible to use getByGestureTestId, which returns gesture, and locate component by the same ID (though I have not tested that with other testing tools).
If you can see that this fails, let me know.
packages/react-native-gesture-handler/src/handlers/handlersRegistry.ts
Outdated
Show resolved
Hide resolved
packages/react-native-gesture-handler/src/v3/hooks/useGesture.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Jakub Piasecki <jakub.piasecki@swmansion.com>
Description
This PR adds handling of
testIDproperty.Test plan
yarn test api_v3