You are here

public function IntegrationTest::testShowTitle in Facets 8

Tests that the configuration for showing a title works.

File

tests/src/Functional/IntegrationTest.php, line 863

Class

IntegrationTest
Tests the overall functionality of the Facets admin UI.

Namespace

Drupal\Tests\facets\Functional

Code

public function testShowTitle() {
  $this
    ->createFacet("Llama", 'llama');
  $this
    ->drupalGet('search-api-test-fulltext');
  $this
    ->assertSession()
    ->pageTextNotContains('Llama');
  $this
    ->drupalGet('admin/config/search/facets/llama/edit');
  $this
    ->drupalPostForm(NULL, [
    'facet_settings[show_title]' => TRUE,
  ], 'Save');
  $this
    ->assertSession()
    ->checkboxChecked('Show title of facet');
  $this
    ->drupalGet('search-api-test-fulltext');
  $this
    ->assertSession()
    ->responseContains('<h3>Llama</h3>');
  $this
    ->assertSession()
    ->pageTextContains('Llama');
}