Fixing filter selection disappearing on back button
Filters regenerate every time the hub images are fetched from redux. When back button is selected, the selected filter is still saved in the state but the values are regenerated with default of undefined which is then set to false. Following updates made to convertArrayToFilterObject to fix issue:
Remove 'false' from or statement (value for filters will default to undefined)
Check if filter does not contain values already
If there are no values already, check if passed image array has size of 1 (i.e. a filter is selected), if so expression will evaluate to true and filter will be given a value of true
Also added an integration with cypress to verify that the filter is still selected (surrounded by blue border) after going to prior page then returning
Closes #246
PR checklist
Docs
[X] If you touched existing code; did you refactor existing naming, added comments where necessary?
Tests
[ ] If your ticket adds new functionality; have you added unit tests to verify behaviour?
[X] If your ticket alters user interaction with the UI; have you added integration tests?
[X] Do your tests check for every convievable user behaviour? (all behaviours the user can perform)
Typing
[ ] If you added new code; have you added typing?
[ ] If you touched existing code; have you improved its typing?
Styling
[ ] If new styles were created; Did you refactor/add more styles in css-in-js style?
Fixing filter selection disappearing on back button
Filters regenerate every time the hub images are fetched from redux. When back button is selected, the selected filter is still saved in the state but the values are regenerated with default of undefined which is then set to false. Following updates made to convertArrayToFilterObject to fix issue:
Also added an integration with cypress to verify that the filter is still selected (surrounded by blue border) after going to prior page then returning
Closes #246
PR checklist
Docs
Tests
Typing
Styling