'Best practice to test component that renders based on data fetched from remote api
I'm creating a small app that has a couple of components that will display information based on data fetched from a remote api. I'm creating tests via Cypress to test the components and I was wondering what would be the best way to test that they display the api data correctly. Should I mock the data that it would normally fetch from the api? Should I fetch the data from the remote api? I've been looking at articles online and some say to mock the data and others to fetch it. What would be best practice?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
