@@ -234,6 +234,83 @@ test('should not fire on non-editable TextInput with nested Text', () => {
234
234
expect ( onChangeTextMock ) . not . toHaveBeenCalled ( ) ;
235
235
} ) ;
236
236
237
+ test ( 'should not fire on none pointerEvents View' , ( ) => {
238
+ const handlePress = jest . fn ( ) ;
239
+
240
+ const screen = render (
241
+ < View pointerEvents = "none" >
242
+ < Pressable onPress = { handlePress } >
243
+ < Text > Trigger</ Text >
244
+ </ Pressable >
245
+ </ View >
246
+ ) ;
247
+
248
+ fireEvent . press ( screen . getByText ( 'Trigger' ) ) ;
249
+ expect ( handlePress ) . not . toHaveBeenCalled ( ) ;
250
+ } ) ;
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 fire on box-none pointerEvents View' , ( ) => {
268
+ const handlePress = jest . fn ( ) ;
269
+
270
+ const screen = render (
271
+ < View pointerEvents = "box-none" >
272
+ < Pressable onPress = { handlePress } >
273
+ < Text > Trigger</ Text >
274
+ </ Pressable >
275
+ </ View >
276
+ ) ;
277
+
278
+ fireEvent . press ( screen . getByText ( 'Trigger' ) ) ;
279
+ expect ( handlePress ) . toHaveBeenCalled ( ) ;
280
+ } ) ;
281
+
282
+ test ( 'should fire on auto pointerEvents View' , ( ) => {
283
+ const handlePress = jest . fn ( ) ;
284
+
285
+ const screen = render (
286
+ < View pointerEvents = "auto" >
287
+ < Pressable onPress = { handlePress } >
288
+ < Text > Trigger</ Text >
289
+ </ Pressable >
290
+ </ View >
291
+ ) ;
292
+
293
+ fireEvent . press ( screen . getByText ( 'Trigger' ) ) ;
294
+ expect ( handlePress ) . toHaveBeenCalled ( ) ;
295
+ } ) ;
296
+
297
+ test ( 'should not fire on box-only pointerEvents View with nested elements' , ( ) => {
298
+ const handlePress = jest . fn ( ) ;
299
+
300
+ const screen = render (
301
+ < View pointerEvents = "box-only" >
302
+ < View >
303
+ < Pressable onPress = { handlePress } >
304
+ < Text > Trigger</ Text >
305
+ </ Pressable >
306
+ </ View >
307
+ </ View >
308
+ ) ;
309
+
310
+ fireEvent . press ( screen . getByText ( 'Trigger' ) ) ;
311
+ expect ( handlePress ) . not . toHaveBeenCalled ( ) ;
312
+ } ) ;
313
+
237
314
test ( 'should pass event up on disabled TouchableOpacity' , ( ) => {
238
315
const handleInnerPress = jest . fn ( ) ;
239
316
const handleOuterPress = jest . fn ( ) ;
0 commit comments