Skip to content

RNGH::Pressable won't work the same as RN::Pressable when using Testing Library #3349

@sidferreira

Description

@sidferreira

Description

The initial discussion can be found at #3347, but I decided to start a new one to set things fresh.

There's also an issue with RNTL callstack/react-native-testing-library#1738

The base line is: react-native-gesture-handler/Pressable is missing some features from react-native/Pressable causing the first not to work like the second with react-native-testing-library.

Some of the issues I found:

  • Missing A11yState handling
  • Even with Pressable disabled, fireEvent.press will trigger events
  • Won't work with fireEvent(el, 'click')
  • Won't work with userEvents.press(el)

I found some initial solutions (Draft PR below) but I have limited time for it.

Steps to reproduce

#3347

Snack or a link to a repository

#3347

Gesture Handler version

main

React Native version

0.76

Platforms

iOS

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions