@@ -234,7 +234,7 @@ test('should not fire on non-editable TextInput with nested Text', () => {
234
234
expect ( onChangeTextMock ) . not . toHaveBeenCalled ( ) ;
235
235
} ) ;
236
236
237
- test . only ( 'should not fire on non-targetable View' , ( ) => {
237
+ test ( 'should not fire on none pointerEvents View' , ( ) => {
238
238
const handlePress = jest . fn ( ) ;
239
239
240
240
const screen = render (
@@ -249,6 +249,38 @@ test.only('should not fire on non-targetable View', () => {
249
249
expect ( handlePress ) . not . toHaveBeenCalled ( ) ;
250
250
} ) ;
251
251
252
+ test ( 'should not fire on box-only pointerEvents View' , ( ) => {
253
+ const handlePress = jest . fn ( ) ;
254
+
255
+ const screen = render (
256
+ < View pointerEvents = "box-only" >
257
+ < Pressable onPress = { handlePress } >
258
+ < Text > Trigger</ Text >
259
+ </ Pressable >
260
+ </ View >
261
+ ) ;
262
+
263
+ fireEvent . press ( screen . getByText ( 'Trigger' ) ) ;
264
+ expect ( handlePress ) . not . toHaveBeenCalled ( ) ;
265
+ } ) ;
266
+
267
+ test ( 'should not fire on none pointerEvents View with nested elements' , ( ) => {
268
+ const handlePress = jest . fn ( ) ;
269
+
270
+ const screen = render (
271
+ < View pointerEvents = "box-only" >
272
+ < View >
273
+ < Pressable onPress = { handlePress } >
274
+ < Text > Trigger</ Text >
275
+ </ Pressable >
276
+ </ View >
277
+ </ View >
278
+ ) ;
279
+
280
+ fireEvent . press ( screen . getByText ( 'Trigger' ) ) ;
281
+ expect ( handlePress ) . not . toHaveBeenCalled ( ) ;
282
+ } ) ;
283
+
252
284
test ( 'should pass event up on disabled TouchableOpacity' , ( ) => {
253
285
const handleInnerPress = jest . fn ( ) ;
254
286
const handleOuterPress = jest . fn ( ) ;
0 commit comments