-
Notifications
You must be signed in to change notification settings - Fork 279
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Ask your Question
I am still quite new to react native and react native testing, so maybe I am missing something.
I have a Swipeable component, something like :
<Swipeable
ref={swipeableRef}
renderLeftActions={renderLeftActions}
renderRightActions={renderRightActions}
onSwipeableLeftOpen={() => decrease(product)}
onSwipeableRightOpen={() => increase(product)}
rightThreshold={70}
leftThreshold={70}
>
<Text style={nameStyle}>{product.name}</Text>
<Text style={quantityStyle}>{product.quantity}</Text>
</Swipeable>
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:
fireEvent(getByText('Bananas'), 'swipeableRightOpen')
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 ?
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested