Fix sorting and filtering tests that passed without verifying anything - #11
Merged
Merged
Conversation
Sorting (search + profile): - getDates used the label `Date "created"` (literal quotes, carried over from the Python suite), which matches nothing, so every created-date sort check compared an empty list. Use the real card labels; mixed-type All tabs read both "Date created" and "Date registered". - Dates were read right after picking a sort option, while the list is still empty. applySort now waits for the index-card-search response with the matching `sort` param before reading. - assertSorting requires at least two dates and getDates rejects unparseable ones, so an empty or broken read fails instead of passing. - Tabs with fewer than two results skip visibly instead of passing. - Users tab cards show no dates, so those two tests now check that each sort option sends the matching SHARE sort request. - Profile preprints tab used the "registered" label; its cards show "Date created". Filtering: - Resource type: select the option by exact name and check the filter chip. The card check is limited to the first card's "Resource type:" line. Registration cards don't show a resource type, so there it relies on the chip and the result count. Previously it picked whichever option came first and looked for any "Registration" text, which every badge on that tab already matches. - All-tab resource type: every card's type badge must match, instead of any one Preprint card being visible, which is already true unfiltered. - Creator / users institution: every result card must contain the value; the old "visible somewhere" check passed on the unfiltered page. - Clearing: compare the filtered count to the option's count, not the unfiltered total. Sort and clearing tests switch tabs through openTab, which waits for the tab's own search response. Otherwise they could read the previous tab's result count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sorting (search + profile):
Date "created"(literal quotes, carried over from the Python suite), which matches nothing, so every created-date sort check compared an empty list. Use the real card labels; mixed-type All tabs read both "Date created" and "Date registered".sortparam before reading.Filtering:
Sort and clearing tests switch tabs through openTab, which waits for the tab's own search response. Otherwise they could read the previous tab's result count.