Files
react-native/Libraries
Eli White 4e31fbd39c Pressable: Update ReactTestTools to be able to tab on Pressable
Summary:
This was all yungsters idea. I blame him. :)

Switching Pressable to be a functional component presents a new challenge. ReactNativeTestTools can no longer find its instance because there is no instance Pressable uses forwardRef.

We need a way to both find a pressable, and then call the onPress callback if the pressable isn't also disabled.

So in DEV (and thus test) we add the pressable config to a secret key on a function passed onto View. The TestTools look for this key on this function, and then can call onPress.

Super hacky, but so is all of ReactNativeTestTools. We aren't proud of this.

Changelog:
[General][Changed]: Added support for Pressable to ReactNativeTestTools.tap

Reviewed By: yungsters

Differential Revision: D18849358

fbshipit-source-id: ea8880ceedfc04cda217ee17ba140475d003172c
2020-01-28 15:14:23 -08:00
..
2020-01-28 14:36:44 -08:00
2019-12-07 10:41:54 -08:00
2020-01-14 08:03:49 -08:00
2020-01-16 14:05:49 -08:00
2019-10-12 15:52:27 -07:00
2019-10-16 10:06:34 -07:00
2019-12-18 19:28:56 -08:00