Skip to content

Fix sorting and filtering tests that passed without verifying anything - #11

Merged
OleksandrTsegelnyk merged 2 commits into
mainfrom
otsehelnyk/fixing_broken_tests
Sep 29, 2026
Merged

OleksandrTsegelnyk merged 2 commits into
mainfrom
otsehelnyk/fixing_broken_tests

Conversation

@OleksandrTsegelnyk

Copy link
Copy Markdown
Collaborator

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.

otsegelnyk and others added 2 commits September 29, 2026 12:24
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>
@OleksandrTsegelnyk
OleksandrTsegelnyk merged commit 7543db1 into main Sep 29, 2026
4 of 9 checks passed
@OleksandrTsegelnyk
OleksandrTsegelnyk deleted the otsehelnyk/fixing_broken_tests branch September 29, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants