You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a scenario when request is being made to save customer details.
After mocking the request and ensuring that it is called I am struggling to verify the actual content of the request.
One thing is that thanks to MSW I can ensure that the request is being called at the correct URL. However, the body contains data that I must ensure is valid when the request is made.
I am struggling to see how this can be achieved? Is this a missing feature or is there a way of verifying this?
The text was updated successfully, but these errors were encountered:
Please see our view at request (and response) assertions. In short, whenever you can confirm the validity of your request/response data in the UI—always prefer that. For example, your POST response may derive some UI state and some elements with the corresponding text appear on the page. Testing those elements is always recommended, as it's precisely what the user of your product will see.
There are, however, cases when responses aren't reflected in the UI. If you're absolutely sure this is your case, consider using the Life-cycle API and basing your assertion around that.
I have a scenario when request is being made to save customer details.
After mocking the request and ensuring that it is called I am struggling to verify the actual content of the request.
One thing is that thanks to MSW I can ensure that the request is being called at the correct URL. However, the body contains data that I must ensure is valid when the request is made.
I am struggling to see how this can be achieved? Is this a missing feature or is there a way of verifying this?
The text was updated successfully, but these errors were encountered: