You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fire a "swipe" event on a Swipeable component #918
I am trying to test that swipe left or right triggers the correct action, however I couldn't find a way to fire a "swipe". I ended firing onswipeableRightOpen ie:
This lets me test my action but I am testing an implementation details here, is there a way to fire a "generic" swipe event? similar to what a real user would do ?
There's no generic swipe event unfortunately. We're operating in React renderer and there's multiple way to achieve this. For your case fireEvent(getByText('Bananas'), 'swipeableRightOpen') should be good enough. If you want generic swipe testing, you'll need to use an e2e testing framework, like Detox or Appium
Activity
thymikee commentedon Feb 16, 2022
There's no generic swipe event unfortunately. We're operating in React renderer and there's multiple way to achieve this. For your case
fireEvent(getByText('Bananas'), 'swipeableRightOpen')should be good enough. If you want generic swipe testing, you'll need to use an e2e testing framework, like Detox or Appiumgaetan-yg commentedon Feb 20, 2022
Thanks !