Why Does Cypress Not Properly Redirect Whenever Using React Router's useSubmit
?
#28539
Unanswered
manavm1990
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using:
"react-router-dom": "^6.21.0"
. I am using Cypress E2E testing ✅.For 'create' in the 'real app:'
and for Cypress:
And, now for 'edit' in 'real app:'
and for Cypress 'edit:'
The point is that Cypress appear in sync, right?
Now, how about delete?
For 'delete' in the 'real app:'
BUT with Cypress:
There is a discrepancy! It doesn't go back to:
GET /contacts 200 3.498 ms - -
afterDELETE
, does it? 👎🏾'Create' and 'Edit' use a
<Form
with a"submit"
button:However, 'delete' 'simulates' the submission outside of a form by using
useSubmit
:In either case, the actions have appropriate
redirect
s:Conclusion?
Cypress is not correctly handling redirects with
useSubmit
as compared withtype="submit"
Beta Was this translation helpful? Give feedback.
All reactions