Closed juliGer closed 2 years ago
Could you make a codesandbox, with relevant component and test code, that reproduces the error?
Could you make a codesandbox, with relevant component and test code, that reproduces the error?
There I tried a smaller code in codesandbox and it worked so it must be something of mine, I am going to review the issue is that I cannot put the code because it is private but I consider the issue closed Thank you very much for answering, greetings!
Hello! I have been able to replicate the error, the problem is that when I want to use mount() with a library called notistack I get this error
https://codesandbox.io/s/shallow-test-app-forked-s7bj8o?file=/src/App.test.js
If you run the tests you can see how it only prints once cant with value 0 and the expected behavior is that it prints
cant: 0 cant: 1
That is, if I don't use notistack, the code performs the expected behavior. Hopefully there is a solution. Thanks and greetings again!
The provider should be passed in with the wrappingComponent
option, not directly wrapping the jsx of the thing you want to test.
The provider should be passed in with the
wrappingComponent
option, not directly wrapping the jsx of the thing you want to test.
Oh, this worked, thank you so much. You're a genius!
Hello! I wanted to see if someone can give me a hand regarding a question I have that I do not know if it is possible to do, and if it is I would like to know what I'm doing wrong so that it does not work.
I have a component that reads a state and that shows it on the screen
Before setstate Chats Operator(0)
After setstate Chats Operator(4)
I see the updated states if I print .instance().state but I would need to render it again with the updated state, I tried .update() as shown in the image but I would not be getting the result I want
Is it possible to do this with enzyme ? Thanks and greetings!
Component
Test
Result Test (Bad)
API
Version
Adapter