abundant-gold-84344
07/08/2022, 6:33 PMbutton
with customhook
called. Based on the response of customhook (false/true), the button text will be changing.
- During initial render, customHook returns false
and the text is xxxx
.
- After clicking
the button, the customHook returns true
and the text will be changed to yyyy
Solution tried:
1 - stubbed the custom hook to return false.
2- mount the button (during which a customhook will be called and return false)
3 - assert the button text to be xxxx
4 - stubbed the custom hook to return true.
5 - cy.get("button").click();
6 - assert the new button text to be yyyy
Outputs:
Error: An import cannot be wrapped 2 times.
Can any one help me on this?