You are here

public function WidgetIntegrationTest::testCustomWidget in Facets 8

Tests custom widget.

::requiredFacetProperties in the custom widget requires the hide_non_narrowing_result_processor processor, so check that it's enabled after the custom widget is selected.

File

tests/src/Functional/WidgetIntegrationTest.php, line 139

Class

WidgetIntegrationTest
Tests the overall functionality of the Facets admin UI.

Namespace

Drupal\Tests\facets\Functional

Code

public function testCustomWidget() {
  $id = 'custom_widget';
  $this
    ->createFacet('Custom widget.', $id);
  $this
    ->drupalGet('admin/config/search/facets/' . $id . '/edit');
  $this
    ->assertSession()
    ->checkboxNotChecked('edit-facet-settings-hide-non-narrowing-result-processor-status');
  $this
    ->assertSession()
    ->checkboxNotChecked('edit-facet-settings-show-only-one-result');
  $this
    ->drupalPostForm(NULL, [
    'widget' => 'custom_widget',
  ], 'Configure widget');
  $this
    ->drupalPostForm(NULL, [
    'widget' => 'custom_widget',
  ], 'Save');
  $this
    ->assertSession()
    ->checkboxChecked('edit-facet-settings-hide-non-narrowing-result-processor-status');
  $this
    ->assertSession()
    ->checkboxChecked('edit-facet-settings-show-only-one-result');
}