Problem/Motivation

The select_a11y_ng module suite currently has no automated test coverage at all. This makes it difficult to ensure correctness when refactoring or adding new features.

Proposed resolution

Add comprehensive test coverage across the module suite:

FunctionalJavascript tests (main module)

  • Test the select_a11y_ng form element renders correctly (single and multiple select)
  • Test search/filtering functionality
  • Test placeholder display
  • Test the field widget with entity reference and list fields
  • Test widget settings form (placeholder, search toggle)
  • Test form submission and value persistence

FunctionalJavascript tests (select_a11y_ng_facets)

  • Test the facets widget renders with the select_a11y_ng element
  • Test facet filtering interaction

FunctionalJavascript tests (select_a11y_ng_bef)

  • Test BEF filter widget renders with the select_a11y_ng element
  • Test BEF sort widget renders with the select_a11y_ng element
  • Test the search configuration option

FunctionalJavascript tests (select_a11y_ng_webform)

  • Test webform select element is replaced by select_a11y_ng when enabled
  • Test webform element configuration form alterations
  • Test mutual exclusion with other select enhancers (Select2, Choices, Chosen)

Kernel tests

  • Test config schema validation for all submodules

Remaining tasks

  • Create test modules with necessary configuration (content types, fields, views, etc.)
  • Implement FunctionalJavascript tests for each submodule
  • Implement kernel tests for config schema
  • Ensure tests pass on both Drupal 10.3+ and Drupal 11
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Issue summary: View changes

  • mably committed d9bcf7f6 on 1.x
    task: #3579873 Add test coverage
    
    By: mably
    
mably’s picture

Assigned: mably » Unassigned
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mably’s picture

Merged. Here is a summary of the changes:

14 files added, 1,525 lines — adds comprehensive test coverage across the entire module suite.

Main module (select_a11y_ng)

  • SelectA11yNGElementTest — 8 kernel tests: form element rendering, single/multiple select, placeholder, custom settings, form submission, valueCallback with target_id.
  • SelectA11yNGWidgetTest — 3 kernel tests: field widget default settings, custom settings, settings summary.
  • SelectA11yNGJavascriptTest — 5 FunctionalJavascript tests: widget initialization, single/multiple select, config attribute, search disabled.
  • SelectA11yNGFieldWidgetTest — 2 FunctionalJavascript tests: field widget rendering on node form, node creation with value saved.
  • select_a11y_ng_test — test module providing a form at /select-a11y-ng-test-form.

select_a11y_ng_bef

  • BefWidgetTest — 4 kernel tests: filter/sort plugin discovery, default configs.
  • BefWidgetJavascriptTest — 2 FunctionalJavascript tests: filter widget renders with config, sort widget renders with search disabled.

select_a11y_ng_facets

  • FacetsWidgetTest — 3 kernel tests: plugin discovery, default config, theme hook registration.
  • FacetsWidgetJavascriptTest — 1 FunctionalJavascript test: facet widget renders select with options.

select_a11y_ng_webform

  • WebformHooksTest — 6 kernel tests: hook alterations, element conversion, skip conditions, conflicting library removal.
  • WebformWidgetJavascriptTest — 1 FunctionalJavascript test: webform element renders with widget and config.

Also adds drupal/search_api to require-dev (needed by facets FunctionalJavascript test).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.