Skip to content

How to "avoid request assertions" ? #2361

Answered by kettanaito
francoisbillet asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, @francoisbillet. Thanks for raising this, I will use this thread for reference since I heard about a similar confusion in the past.

How to avoid request assertions

The best practice in the docs is meant to be a safe default. Most teams and most tests must focus on testing the UI, asserting what happens in the realm observable by the user. There are exceptions to this, and the page mentions those too! Not all requests will find reflection in the UI. Some won't. For those, it's okay to assert on the request itself.

We have a boolean flag that we set to true if the update of the product is called with the proper params and body.

Drop this state and instead return a mocked 400 respons…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@francoisbillet
Comment options

@kettanaito
Comment options

@francoisbillet
Comment options

Answer selected by francoisbillet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants