Closed markaustinws closed 3 months ago
getGestureById
method will retrieve the gesture object, it's not meant to bring components
// Pan gesture in some component
const pan = Gesture.Pan().withTestID("pan")
test("some tests", () => {
render(<SomeComponent />) // Some component with the gesture shown above
const pan = getGestureById("pan");
})
With code like this you will get the pan gesture.
I'm trying to get the gesture from the Swipeable component. Is this not possible?:
render(<Swipeable testID="swipeable" />);
getByGestureTestId("swipeable");
Erroring with Handler with id: 'swipeable' cannot be found
Description
Trying to retrieve a swipeable component using getByGestureTestId, but it's failing. Seems that the Test ID does not get rendered
Steps to reproduce
test("GetByGestureTestId", async () => { // const swipeable = screen.getByTestId("mySwipe");
});
Handler with id: 'abcd' cannot be found
Screen debug:
Snack or a link to a repository
https://snack.expo.dev/@mausti/tenacious-green-tortillas
Gesture Handler version
2.18.1
React Native version
0.74.3
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
Expo managed workflow
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
None
Device model
No response
Acknowledgements
Yes