cds-snc / c19-benefits-node

Answer some questions to find which federal programs can help you https://covid-benefits.alpha.canada.ca/. - Répondez à quelques questions pour trouver quels programmes d’aide financière fédéraux s’offrent à vous https://covid-prestations.alpha.canada.ca/.
MIT License
2 stars 4 forks source link

Fix the issue with hitting back and receiving multiple benefits #384

Closed CalvinRodo closed 4 years ago

CalvinRodo commented 4 years ago

Description

Add a pruneSessionData method to the session.helpers.js that allows us to remove form data from the session.

This fixes the bug where the user uses the back key to navigate back to see what a different path would return and we ended up with multiple benefits.

Also adds a test that duplicates this bug.

Closes #378

To Test

Navigate around the site using the back button to go back to some forks in the flow and visit down those.

You should only see benefits that are relevant to the fork you are on.

Figma is really useful for visualizing the different paths.

michellengaiCDS commented 4 years ago

Found another path that will show CERB incorrectly. Route 1: Income not affected - You're on paid leave - etc. - doesn't show CERB as designed.

Then I did Route 2: Some income lost - You're retired and lost part time work - $5,000 or more - etc. shows CERB as designed.

Then I went back and did Route 1 again, it showed CERB when it shouldn't have. Went back again to Route 2 and saw that the $5,000 or more option was still selected as I was going through it.

michellengaiCDS commented 4 years ago

Looks good, thanks for fixing it so quickly.