-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DH/Bug : Links format filter filters out everything #668
Conversation
Affected libs:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! I see two things here:
- The unit tests (
downloads-list.component.spec.ts
) would probably be a better place to test this behaviour; it looks like thetoggleFilterFormat
method is not actually tested there, so this looks like a good time to add tests for it 🙂 Kudos for adding an associated test though!
(Note that you can of course keep the e2e test as well) - Nested ternary operations usually only make sense for their author; it's surprisingly hard to read for anyone else. I for one would really appreciate if you could instead define an intermediate variable like
bool noActiveFormat
😉
I added a commit addressing my own comments, will merge once everything is green |
chore(dh): add e2e test feat(downloads): clarify logic, add unit tests Backported from #668
backported in 67c862f |
Summary
This PR fixes the behavior of the downloads filter.
Issue
When clicking on one filter and clicking again on it, the download list becomes empty.
Fix
When clicking on one filter and clicking again on it, the download list falls back to 'All' and shows all download links.
How to test
Go to a dataset with download links with multiple formats, eg :
/dataset/ee965118-2416-4d48-b07e-bbc696f002c2
, and click twice on the same format filter in the downloads section.