The multi-category filter needs to be an actual set of labeled checkboxes

Created on 5 November 2024, 16 days ago

Problem/Motivation

The multi-checkbox category dropdown filter's markup is atrocious. It is a pile of DIVs and checkboxes that are not semantically arranged like form elements, and that means the tests are extremely flaky when interacting it because they have to do bullshit like this:

    $second_category_filter_selector = '.pb-filter__multi-dropdown .pb-filter__checkbox-label:nth-child(2) input[type="checkbox"]';

Come on. This is not sustainable.

Let's change the markup so it's more like this:

<div><label for="category-ID"><input type="checkbox" id="category-ID" value="ID" />Category name (ID)</label></div>

Then we should be able to do this in tests, which is both more readable and probably (hopefully) more stable:

$assert_session->fieldExists('Category name (ID)')->check();

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @phenaproxima
  • First commit to issue fork.
  • Merge request !614Resolve #3485747 "The multi category filter" → (Open) created by pfrilling
  • Pipeline finished with Failed
    6 days ago
    Total: 338s
    #340198
  • 🇺🇸United States pfrilling Minster, OH

    Looking into this at NEDCamp. Adding the issue tag.

  • Pipeline finished with Failed
    6 days ago
    Total: 327s
    #340212
  • Pipeline finished with Failed
    6 days ago
    Total: 345s
    #340252
  • Pipeline finished with Failed
    6 days ago
    Total: 328s
    #340254
  • Pipeline finished with Failed
    6 days ago
    Total: 332s
    #340259
  • Pipeline finished with Failed
    6 days ago
    Total: 324s
    #340269
  • Pipeline finished with Failed
    6 days ago
    Total: 335s
    #340272
  • Pipeline finished with Failed
    6 days ago
    Total: 577s
    #340280
  • 🇺🇸United States chrisfromredfin Portland, Maine
  • Pipeline finished with Failed
    6 days ago
    Total: 327s
    #340297
  • 🇺🇸United States pfrilling Minster, OH

    The markup changes have been completed and the testing is all passing. This is ready for review.

  • Pipeline finished with Failed
    6 days ago
    Total: 405s
    #340320
  • 🇺🇸United States chrisfromredfin Portland, Maine

    fail - can't find by that selector. close, though!

        There was 1 failure:
        
        1)
        Drupal\Tests\project_browser\FunctionalJavascript\ProjectBrowserUiTestJsonApi::testMultiplePlugins
        Behat\Mink\Exception\ElementNotFoundException: Element matching css
        ".pb-filter__checkbox-label-txt" not found.    
    
  • Pipeline finished with Failed
    6 days ago
    Total: 289s
    #340381
  • Pipeline finished with Failed
    6 days ago
    Total: 334s
    #340383
  • Pipeline finished with Failed
    1 day ago
    Total: 7008s
    #344028
  • Pipeline finished with Failed
    1 day ago
    Total: 475s
    #344086
  • Pipeline finished with Failed
    1 day ago
    Total: 418s
    #344103
Production build 0.71.5 2024