Problem/Motivation
We have decent test coverage of most of our Views plugins in terms of Functional tests for using views that involve our plugins.
However, we don't have any test coverage of the Views UI parts of the plugins themselves (e.g. settings forms for configuring filters, etc).
For example, this led to #3087201: Views exposed filter for Administrative Area based on exposed Country Code filter not working where the views settings UI for the administrative area filter was broken in #3034122: Rename the 'country_code' views field and filter to 'country' and no one knew about it at the time.
Proposed resolution
Add some FunctionalJavascript tests that confirm the settings forms (and other UI?) of our Views plugins continues to work as expected.
Remaining tasks
Do it.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | views_ui_test-3087833-9.patch | 30.22 KB | sickness29 |
Comments
Comment #2
sickness29 commentedComment #3
sickness29 commentedAdded UI tests for views handlers provided by address module.
There are 3 cases, each for field, filter and sort handlers.
During test development I found issue with ajax on administrative_area filter handler: when filter is configured right after it's added the ajax in options form does not behave correctly. When country source is selected the options form is closed and user is taken to previous filters selection screen. This happens because ajax in form was initiated during views ajax call and it has wrong url, so I checked how views module does this and found web/core/modules/views/src/Plugin/views/field/EntityField.php:477 which does the trick.
Please let me know if I should change task description to include info on this issue.
Comment #6
bojanz commentedThank you!
Comment #8
bojanz commentedHad to revert this from 2.0.x because it wasn't passing.
Comment #9
sickness29 commentedAfter update the code for Madrid administrative area became M as seen in vendor/commerceguys/addressing/src/Subdivision/SubdivisionUpdater.php:273
So I had to update test data and test should pass now
Comment #11
bojanz commentedThank you!