Closed yogendrakumar96 closed 2 years ago
You’re using shallow, so componentDidMount won’t fire because it’s not mounted.
But when I use mount is is saying "Cannot read properties of undefined (mount)" like this. Is there any way to test this. Can you please help me about this.
Can you make a codesandbox using https://codesandbox.io/s/react-jest-and-enzyme-testing-9vo14 that reproduces the problem?
No I can't as data is coming from local storage, can you please suggest me a way to write the test cases for componentDidMount which is getting the data from local storage and setting state inside of the life cycle method
Without a codesandbox it's not an easy ask, and unfortunately I don't have enough free time to provide consulting services. I'd suggest StackOverflow for that :-) Good luck!