COVID-19-electronic-health-system / Corona-tracker

An easy-to-use PWA to monitor the user's wellness and learn about COVID-19.
https://coronatracker.me/
MIT License
235 stars 101 forks source link

Fixbug redirect onboard #642

Closed liadove closed 4 years ago

liadove commented 4 years ago

⚠️ IMPORTANT: Please do not create a Pull Request without creating an issue first.

All changes need to be discusssed before proceeding. Failure to do so may result in the pull request being rejected.

Please be sure to review our Code of Conduct, Contributing Guidelines, and Support documentation before submitting a pull request.


Please include the issue number the pull request fixes by replacing YOUR-ISSUE-HERE in the text below.

Fixes https://github.com/COVID-19-electronic-health-system/Corona-tracker/issues/581

Summary

Was created a variable showOnboard in the onboarding redux store to indicate if the user didn't fill out onboarding information. The App component will re-render when showOnboard variable will be changed.

Details

I had an issue to figure out how to re-render the App component because only there we can check if the user filled out onboard info, and when we fetch the data from the backend we needed time to get the user data, so it won't get the data right away and component already would load, so I created showOnboard variable to re-render the App component.

Test Plan (required)

Final Checklist

acthelemann commented 4 years ago

Oh yeah, there's a failing test

liadove commented 4 years ago

@acthelemann Yes, I think it's because I added showOnboard in redux. I don't know if I can change the test

acthelemann commented 4 years ago

@liadove Since SET_DEMOGRAPHICS_COMORBIDITIES now sets showOnboard to !action.formData.age, you'll have to update the toEqual function call in the failing test to pass in the object with showOnboard set to false.

If you need more explanation on this, let me know

liadove commented 4 years ago

@acthelemann Everything passed, thanks!