swsnu / swppfall2021

Learning Software Engineering By Building Web Services
28 stars 19 forks source link

[hw3] error at App.test.js #97

Open tippy33 opened 2 years ago

tippy33 commented 2 years ago

Hello, I'm consistently having an error at App.test.js, which is:

Could not find "store" in the context of "Connect(withRouter(Login))". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(withRouter(Login)) in connect options. For this file is given from the beginning, I do not know why this is happening.. I've tried to give Provider, but it gives another error and the problem is not solved. Could you please help me with this error? Thank you very much.

kdh0102 commented 2 years ago

I have checked your codes and it looks easy for you to follow codes from our practice to render App. I suggest you to try to refer to the App.test.js file from our practice repo: https://github.com/chang-jin/swpp-unittest-tutorial/blob/final/src/App.test.js

tippy33 commented 2 years ago

Thank you, I followed as you told me, and updated my App.js code from exact render={<.../>} to exact component={...} and it worked well.