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
Hi, I have been trying to write some tests for my library however the documentation offers no relevant information at all about how to test this library and I feel lost, I'm currently trying to test whether a gesture has been disabled after some particular action.
I need to check if the pan gesture has been disabled after the pinch gesture executed its onStart method, this is what I currently have.
test('disable all other gestures when pinch has started',()=>{render(<Viewstyle={styles.root}><ResumableZoom><Imagesource={undefined}style={styles.image}/></ResumableZoom></View>);act(()=>{fireGestureHandler<PinchGesture>(getByGestureTestId('pinch'),[{state: State.BEGAN},{state: State.UNDETERMINED},]);jest.runAllTimers();});constpan=getByGestureTestId('pan');expect(pan.config.enabled).toBe(false);});
At the moment I'm sure the onStart methods works fine, however when I retrieve the gesture it always returns a value with the value of pan.config.enable set to true when I expect it to be false.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I have been trying to write some tests for my library however the documentation offers no relevant information at all about how to test this library and I feel lost, I'm currently trying to test whether a gesture has been disabled after some particular action.
Assuming we have a code like this one
I need to check if the pan gesture has been disabled after the pinch gesture executed its onStart method, this is what I currently have.
At the moment I'm sure the onStart methods works fine, however when I retrieve the gesture it always returns a value with the value of pan.config.enable set to true when I expect it to be false.
Hope someone can help, thanks.
Beta Was this translation helpful? Give feedback.
All reactions