TLDR Web Dev · ARTICLES & TUTORIALS
DO NOT ASSERT ON REQUESTS (DO THIS INSTEAD)
Summary from the TLDR Web Dev newsletter
Instead of directly asserting on API requests in UI tests, it's better to focus on testing UI state. This is because users don't care about API calls and only about the UI's behavior. For example, instead of asserting that a POST /cart request was made, you should test that clicking "Add to cart" shows the success message to emulate real user experience.