Skip to content

How to mock function props in React unit tests #16867

Discussion options

You must be logged in to vote

I found the answer myself: Apparently the code I wrote is just fine but Cypress executes the assertion block before the blurevent finishes. So we need to move the assertion into a .then() after blur():

cy.get("body").find("input").type("{selectall}30m").blur().then(() => { /* assertion here */ })

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by flexwie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant