File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/react-native-gesture-handler/src/v3/components Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -39,9 +39,10 @@ import { GestureDetector } from '../detectors';
3939import { PureNativeButton } from './GestureButtons' ;
4040
4141import { PressabilityDebugView } from '../../handlers/PressabilityDebugView' ;
42- import { INT32_MAX } from '../../utils' ;
42+ import { INT32_MAX , isTestEnv } from '../../utils' ;
4343
4444const DEFAULT_LONG_PRESS_DURATION = 500 ;
45+ const IS_TEST_ENV = isTestEnv ( ) ;
4546
4647const Pressable = ( props : PressableProps ) => {
4748 const {
@@ -370,7 +371,11 @@ const Pressable = (props: PressableProps) => {
370371 touchSoundDisabled = { android_disableSound ?? undefined }
371372 rippleColor = { rippleColor }
372373 rippleRadius = { android_ripple ?. radius ?? undefined }
373- style = { [ pointerStyle , styleProp , { minWidth : 44 , minHeight : 44 } ] } >
374+ style = { [ pointerStyle , styleProp , { minWidth : 44 , minHeight : 44 } ] }
375+ testOnly_onPress = { IS_TEST_ENV ? onPress : undefined }
376+ testOnly_onPressIn = { IS_TEST_ENV ? onPressIn : undefined }
377+ testOnly_onPressOut = { IS_TEST_ENV ? onPressOut : undefined }
378+ testOnly_onLongPress = { IS_TEST_ENV ? onLongPress : undefined } >
374379 { childrenProp }
375380 { __DEV__ ? (
376381 < PressabilityDebugView color = "red" hitSlop = { normalizedHitSlop } />
You can’t perform that action at this time.
0 commit comments