-
Notifications
You must be signed in to change notification settings - Fork 276
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Ask your Question
Hi, sorry for the noob question here. I am new to testing. I wanted to know how can we cover the API test with RNTL? For example, I want to test the following.
const res = await sendFeedback(feedbackObj);
if (res.data) {
showMessage({
message: 'Thanks for your feedback!',
type: 'success',
icon: 'success',
});
setIsSubmitting(false);
Keyboard.dismiss();
navigation.goBack();
} else {
showMessage({
message: 'Something went wrong. Please try again later.',
type: 'danger',
icon: 'danger',
});
setIsSubmitting(false);
}
Here I want to put a test condition for the success branch. Is this a right thing to do with RNTL or I should think in a different way? Thanks a lot!
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested