Testing · Middle · Question 20 of 75
How do you check what a component sent to the API when using MSW?
- ✓Correct answer: Assert on the UI result, or capture the request body in the handler and check it
- 2MSW can't see request bodies
- 3Spy on
window.fetchin addition to MSW
Explanation
Prefer user-visible outcomes; check the payload only when it matters (e.g. the exact data sent to save).