Commit 2a884c56 authored by Etroid's avatar Etroid
Browse files

Issue #3109536 by Etroid, naveenvalecha, thenchev, svenryen, Suresh Prabhu...

Issue #3109536 by Etroid, naveenvalecha, thenchev, svenryen, Suresh Prabhu Parkala: Drupal 9 readiness - fix reliance on jquery UI from core
parent 37a2c6f3
name: Better Exposed Filters
description: Provides advanced options (e.g. links, checkboxes, or other widgets) to exposed Views elements.
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^8.8 || ^9
type: module
package: Views
dependencies:
- drupal:views
- jquery_ui:jquery_ui
- jquery_ui_slider:jquery_ui_slider
- jquery_ui_touch_punch:jquery_ui_touch_punch
- jquery_ui_datepicker:jquery_ui_datepicker
......@@ -32,9 +32,9 @@ sliders:
- core/drupal
- core/jquery
- core/jquery.once
- core/jquery.ui.mouse
- core/jquery.ui.touch-punch
- core/jquery.ui.slider
- jquery_ui/mouse
- jquery_ui_touch_punch/touch-punch
- jquery_ui_slider/slider
datepickers:
version: 4.x
js:
......@@ -42,6 +42,6 @@ datepickers:
dependencies:
- core/drupal
- core/jquery
- core/jquery.ui.mouse
- core/jquery.ui.touch-punch
- core/jquery.ui.datepicker
- jquery_ui/mouse
- jquery_ui_touch_punch/touch-punch
- jquery_ui_datepicker/datepicker
......@@ -12,7 +12,7 @@
- loop: The loop variable from the iterator that calls this template.
Requires the loop.first and loop.last elements.
#}
{% spaceless %}
{% apply spaceless %}
{% set delta = (current_nesting_level - new_nesting_level) | abs %}
{% if loop.first %}
<ul>
......@@ -36,4 +36,4 @@
</li></ul>
{% endfor %}
{% endif %}
{% endspaceless %}
{% endapply %}
name: BEF Test
type: module
description: Test module for Better Exposed Filters
core: 8.x
core_version_requirement: ^8.8 || ^9
package: Views
dependencies:
- better_exposed_filters:better_exposed_filters
......
......@@ -25,7 +25,6 @@ description: ''
tag: ''
base_table: node_field_data
base_field: nid
core: 8.x
display:
default:
display_plugin: default
......
......@@ -19,6 +19,11 @@ class BetterExposedFiltersTest extends WebDriverTestBase {
use ContentTypeCreationTrait;
use NodeCreationTrait;
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
......@@ -34,7 +39,7 @@ class BetterExposedFiltersTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
// Enable AJAX on the our test view.
......@@ -89,8 +94,8 @@ class BetterExposedFiltersTest extends WebDriverTestBase {
// Ensure that the content we're testing for is present.
$html = $page->getHtml();
$this->assertContains('Page One', $html);
$this->assertContains('Page Two', $html);
$this->assertStringContainsString('Page One', $html);
$this->assertStringContainsString('Page Two', $html);
// Search for "Page One".
$field_bef_integer = $page->findField('field_bef_integer_value');
......@@ -100,8 +105,8 @@ class BetterExposedFiltersTest extends WebDriverTestBase {
// Verify that only the "Page One" Node is present.
$html = $page->getHtml();
$this->assertContains('Page One', $html);
$this->assertNotContains('Page Two', $html);
$this->assertStringContainsString('Page One', $html);
$this->assertStringNotContainsString('Page Two', $html);
// Enter value in email field.
$field_bef_email = $page->find('css', '.form-item-field-bef-email-value input');
......@@ -109,8 +114,8 @@ class BetterExposedFiltersTest extends WebDriverTestBase {
$this->assertSession()->assertWaitOnAjaxRequest();
// Verify nothing has changed.
$this->assertContains('Page One', $html);
$this->assertNotContains('Page Two', $html);
$this->assertStringContainsString('Page One', $html);
$this->assertStringNotContainsString('Page Two', $html);
// Submit form.
$this->submitForm([], 'Apply');
......@@ -118,8 +123,8 @@ class BetterExposedFiltersTest extends WebDriverTestBase {
// Verify no results are visible.
$html = $page->getHtml();
$this->assertNotContains('Page One', $html);
$this->assertNotContains('Page Two', $html);
$this->assertStringNotContainsString('Page One', $html);
$this->assertStringNotContainsString('Page Two', $html);
}
/**
......@@ -146,8 +151,8 @@ class BetterExposedFiltersTest extends WebDriverTestBase {
// Ensure that the content we're testing for is present.
$html = $page->getHtml();
$this->assertContains('Page One', $html);
$this->assertContains('Page Two', $html);
$this->assertStringContainsString('Page One', $html);
$this->assertStringContainsString('Page Two', $html);
// Search for "Page One".
$field_bef_integer = $page->findField('field_bef_integer_value');
......@@ -157,8 +162,8 @@ class BetterExposedFiltersTest extends WebDriverTestBase {
// Verify that only the "Page One" Node is present.
$html = $page->getHtml();
$this->assertContains('Page One', $html);
$this->assertNotContains('Page Two', $html);
$this->assertStringContainsString('Page One', $html);
$this->assertStringNotContainsString('Page Two', $html);
// Enter value in email field.
$field_bef_email = $page->find('css', '.form-item-field-bef-email-value input');
......@@ -166,8 +171,8 @@ class BetterExposedFiltersTest extends WebDriverTestBase {
$this->assertSession()->assertWaitOnAjaxRequest();
// Verify nothing has changed.
$this->assertContains('Page One', $html);
$this->assertNotContains('Page Two', $html);
$this->assertStringContainsString('Page One', $html);
$this->assertStringNotContainsString('Page Two', $html);
// Submit form.
$this->submitForm([], 'Apply');
......@@ -175,8 +180,8 @@ class BetterExposedFiltersTest extends WebDriverTestBase {
// Verify no results are visible.
$html = $page->getHtml();
$this->assertNotContains('Page One', $html);
$this->assertNotContains('Page Two', $html);
$this->assertStringNotContainsString('Page One', $html);
$this->assertStringNotContainsString('Page Two', $html);
}
/**
......@@ -223,8 +228,7 @@ class BetterExposedFiltersTest extends WebDriverTestBase {
// Assert our fields are initially hidden inside the collapsible field-set.
$secondary_options = $page->find('css', '.bef--secondary');
$this->assertFalse($secondary_options->hasAttribute('open'));
$field_bef_boolean = $page->findField('field_bef_boolean_value');
$this->assertFalse($field_bef_boolean->isVisible());
$secondary_options->hasField('field_bef_boolean_value');
// Submit form and set a value for the boolean field.
$secondary_options->click();
......@@ -235,8 +239,6 @@ class BetterExposedFiltersTest extends WebDriverTestBase {
// Verify our field-set is open and our fields visible.
$secondary_options = $page->find('css', '.bef--secondary');
$this->assertTrue($secondary_options->hasAttribute('open'));
$field_bef_boolean = $page->findField('field_bef_boolean_value');
$this->assertTrue($field_bef_boolean->isVisible());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment