Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

fireEvent on Text elements #3

Closed
mcgloneleviROOT opened this issue Apr 11, 2019 · 3 comments
Closed

fireEvent on Text elements #3

mcgloneleviROOT opened this issue Apr 11, 2019 · 3 comments

Comments

@mcgloneleviROOT
Copy link
Contributor

Problem:

I was using this testing framework to test an onPress event on a Text component from React Native. When I ran this line:

fireEvent.press(wrapper.getByText('Open Settings'));

I received this error:

No target found for event: "press"

I believe "Text" should be added under eventMap.press.validTargets in https://github.com/bcarroll22/native-testing-library/blob/master/src/events.js

@mcgloneleviROOT
Copy link
Contributor Author

It looks like text elements can be the target of press, longPress, pressIn, pressOut events:

https://github.com/facebook/react-native/blob/master/Libraries/Text/Text.js

@bcarroll22
Copy link
Collaborator

Fixed in 1.5.1

@mcgloneleviROOT
Copy link
Contributor Author

Thank you!!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants