So in my program, when a user logs in, if all credentials are correct they will proceed to the next page if any details are missing or incorrect format, and alert is shown on screen.
How do I test using Jest in React Native if the alert has been displayed after a button press, and confirm that the text of the alert is correct?
Some of my component is shown below:
...
.catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
alert(errorMessage)
});
The error text is generated by Google's Firebase, but I do know what it is.