App error: failed to fetch from unhandled promise rejection
Expected behaviour
When a promise is rejected it should be handled. As of Node.js version 15 and later, unhandled promise rejections will cause the Node.js process to terminate by default.
Current behaviour
During tests execution on pipeline and locally I noticed the following error:
Error: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.
> Failed to fetch
When Cypress detects uncaught errors originating from your application it will automatically fail the current test.
This behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.
https://on.cypress.io/uncaught-exception-from-application
Steps to reproduce
- On pipeline usually happens when app starts redirects to login.
- And the second time this happens is when updating the team of the book component. Add a new member to the team and save it.
Environment
Possible solution
Handle with .catch()
method or a try...catch block
QA Steps
[To be completed by Coko once dev is done]