Here’s a cleaner version with the empty list item removed and the wording tightened.

Problem/Motivation

#3547913: Introduce automated tests added the module’s first automated tests. Thanks @vitaliyb98!

This follow-up expands that coverage now that the test harness is in place.

Proposed resolution

  • Add kernel test coverage for negative paths where nothing should be attached:
    • AJAX history is disabled.
    • AJAX is disabled on the display.

    These guard the conditions in views_ajax_history_views_pre_render() and confirm that neither the views_ajax_history/history library nor viewsAjaxHistory settings are added.

  • Expand kernel test coverage for exclude_args parsing by using a multi-line value with newlines, spaces, and a blank line. Assert that the value is split into the expected list with empty values filtered out, covering the preg_split() and array_filter() logic.
  • Improve kernel test coverage for the initialExposedInput setting by supplying exposed input and asserting that it is stored under the expected views_dom_id:<id> key with the correct values.
  • Improve functional test readability by giving the useAjaxParamsCases data provider named string keys so failures report meaningful case names instead of #0, #1, etc.
  • Add a comment explaining that the #views-page-1-use-ajax selector is coupled to Views UI markup.
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

joelpittet created an issue. See original summary.

scott_euser made their first commit to this issue’s fork.

scott_euser’s picture

Assigned: Unassigned » scott_euser
scott_euser’s picture

Assigned: scott_euser » Unassigned
Status: Active » Needs review

I think that should do it, all your bullet points should be covered. I'll create a separate issue then for functional JS tests to cover how this differs from core + other bits in the .js file

joelpittet’s picture

Status: Needs review » Fixed

Thanks for taking this on @scott_euser. Nice to have a bit of stronger test coverage. Of course it won't catch all bugs, the potential is huge compared to not having any.

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.

scott_euser’s picture

Thanks! I also created https://www.drupal.org/project/views_ajax_history/issues/3594139 for functional JS ones which I think will help even more; particularly as that's where this module deviates from Core's new ajax (per Berdir and my texts here https://www.drupal.org/project/views_ajax_history/issues/3563971#comment... )

Status: Fixed » Closed (fixed)

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