codeforboston / maple

MAPLE makes it easy for anyone to view and submit testimony to the Massachusetts Legislature about the bills that will shape our future.

Home Page:https://mapletestimony.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Browse Testimony page filtering using tabs (author role) returning inconsistent results

seatuna opened this issue · comments

While writing tests, I found some inconsistencies on the Browse Testimony page when filtering for individual or organizations and then going back to getting all results. At a glance, it looks like the filters are working but it's definitely returning a different number of results specifically when going back to "all" after viewing other filters.

We need to make sure the url params are being set properly and that setting the params actually fire the correct request.

To Reproduce
Steps to reproduce the behavior:

  1. From the homepage, click "Browse All Testimony". The page defaults to the "all" tab, note the total # of results (144 in staging), and the court filter (144 for court 193, 119 for 192)
  2. Click the "Individuals" or "Organizations" tab. The numbers and results change as expected. Url has expected "authorRole" params
  3. Click on the "All" tab again. The numbers are not the same as when we first go to this page. Total results are 114 (should be 144), court 193 has 114 (should be 144), 192 has 96 (should be 192). Also, the url now has the author Role param set to organization (but definitely not displaying organization filtered results). Likely a bug with setting params, but it looks like it may not actually be filtering for organization.

Expected behavior
Clicking between "All", "Individuals", and "Organizations" tabs on the Testimony page should always yield the same results.
Going from Individuals -> All or Organizations -> All should return the same results as when clicking on "Browse Testimony" from the MAPLE homepage
URL params for "authorRole" should either be empty or set to "all" when filtering for "All" author roles

Actual Results + Screenshots
Going from homepage to "Browse Testimony" page, default shows "All" testimonies, no authorRole param in URL
Screen Shot 2024-06-24 at 5 58 04 PM

Filtering for "Individuals", authorRole=user
Screen Shot 2024-06-24 at 6 00 16 PM

Filtering for "Organizations", authorRole=organization
Screen Shot 2024-06-24 at 6 02 00 PM

Filtering back to "All", authorRole=organization, results count is different from the initial page load
Screen Shot 2024-06-24 at 6 03 32 PM

Desktop (please complete the following information):

  • OS: MacOS Catalina 10.15.7 (19H2026)
  • Browser: Chrome
  • Version: Version 126.0.6478.63 (Official Build) (x86_64)