-
I have a touchable component that uses reanimated internally to trigger handle user interaction: function MyButton({onPress}) {
const eventHandler = useAnimatedGestureHandler<TapGestureHandlerGestureEvent>(
{
onStart: () => {
// do something
},
onFail: () => {
// do something 2
},
onEnd: () => {
// do something 3 and then call the press handler prop:
runOnJS(onPress)()
},
}
)
return (
<TapGestureHandler onGestureEvent={eventHandler}>
<Text>My Button</Text>
</TapGestureHandler>
)
} What would be the proper way to interact with these callbacks on a Jest environment? When trying to trigger press event in my Jest tests (using testing-library) I get the error The test code looks something like: const button = screen.getByText('My Button')
fireEvent.press(button) Also tried |
Beta Was this translation helpful? Give feedback.
Answered by
piaskowyk
Dec 15, 2021
Replies: 1 comment
-
Hey @sbalay 👋 At this moment you have two options:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sbalay
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @sbalay 👋
At this moment you have two options: