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
Don't display Document Collection withdrawn documents #205
Conversation
|
||
groups_without_withdrawn_documents = presenter.groups.first["documents"] | ||
|
||
number_of_documents_that_have_withdrawn_false = 2 |
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.
Not happy with this but because both group_documents
and documents_hash
are private I couldn't figure out a neater way to check that the withdrawn ones have been excluded. The only downside with doing this is if somebody goes and modifies the example by say, adding another document, 99% chance is they will break these tests. However, that happens rare enough that this should be fine.
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.
And then expected_number_of_presented_documents
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.
Looks good apart from the naming which, as we all know, is hard 😄
"document_collection_with_withdrawn_links_documents" | ||
) | ||
|
||
groups_without_withdrawn_documents = presenter.groups.first["documents"] |
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.
I don't think this name correctly describes what is returned here. This returns (or should return for the test to pass) a collection of non-withdrawn documents. Maybe non_withdrawn_documents
might be a better name?
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.
Or possibly just presented_documents
? The withdrawn bit is redundant as that is in the name of the test.
|
||
groups_without_withdrawn_documents = presenter.groups.first["documents"] | ||
|
||
number_of_documents_that_have_withdrawn_false = 2 |
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.
And then expected_number_of_presented_documents
69cba15
to
d7c74df
Compare
d7c74df
to
01bd7f4
Compare
This brings government-frontend in line with Whitehall. Trello: https://trello.com/c/IFfWVlb6/533-filter-out-withdrawn-documents-in-document-collections-medium Follow-up to: - alphagov/govuk-content-schemas#454 - alphagov/publishing-api#627 Depends on: - alphagov/govuk-content-schemas#459
01bd7f4
to
4687ffb
Compare
This brings government-frontend in line with Whitehall, which doesn't show withdrawn documents.
Trello:
https://trello.com/c/IFfWVlb6/533-filter-out-withdrawn-documents-in-document-collections-medium
Follow-up to:
Depends on:
Before
Below screenshots use the fictional
/government/collections/with-withdrawn-links-documents
example I created that hasFinancial sanctions, Somalia
marked as withdrawn.After