-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add Clickable mock
#4055
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: main
Are you sure you want to change the base?
Add Clickable mock
#4055
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,3 +8,4 @@ export const RawButton = ({ enabled, children, ...rest }: any) => ( | |||||||||||||||||||||||||||||||||
| export const BaseButton = RawButton; | ||||||||||||||||||||||||||||||||||
| export const RectButton = RawButton; | ||||||||||||||||||||||||||||||||||
| export const BorderlessButton = TouchableNativeFeedback; | ||||||||||||||||||||||||||||||||||
| export const Clickable = RawButton; | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
| export const Clickable = RawButton; | |
| export const Clickable = ({ | |
| onPress, | |
| onLongPress, | |
| onPressIn, | |
| onPressOut, | |
| ...rest | |
| }: any) => ( | |
| <RawButton | |
| {...rest} | |
| onPress={() => onPress?.(true)} | |
| onLongPress={() => onLongPress?.(true)} | |
| onPressIn={() => onPressIn?.(true)} | |
| onPressOut={() => onPressOut?.(true)} | |
| /> | |
| ); |
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.
Clickableis a v3 export (src/v3/components/index.ts->src/v3/components/Clickable/Clickable), but this mock file is used to mock./src/components/GestureButtons(legacy) injestSetup.js. ExportingClickablehere likely won’t affectimport { Clickable } from 'react-native-gesture-handler'in tests, so the PR may not actually provide a Jest mock for the publicClickableAPI. Consider adding a dedicated v3Clickablemock and wiring it up injestSetup.js(e.g., mock./src/v3/components/Clickable/Clickableor./src/v3/components).