diff --git a/tests/src/FunctionalJavascript/WidgetJSTest.php b/tests/src/FunctionalJavascript/WidgetJSTest.php index 3559e66..3604197 100644 --- a/tests/src/FunctionalJavascript/WidgetJSTest.php +++ b/tests/src/FunctionalJavascript/WidgetJSTest.php @@ -50,8 +50,9 @@ class WidgetJSTest extends JavascriptTestBase { */ public function testCheckboxWidget() { $facet_storage = \Drupal::entityTypeManager()->getStorage('facets_facet'); - $id = 'llama'; + + // Create and save a facet with a checkbox widget on the 'type' field. $facet = $facet_storage->create([ 'id' => $id, 'name' => strtoupper($id), @@ -64,15 +65,25 @@ class WidgetJSTest extends JavascriptTestBase { $facet->save(); $this->createBlock($id); + // Go to the views page. $this->drupalGet('search-api-test-fulltext'); + // Make sure the block is shown on the page. $page = $this->getSession()->getPage(); $page_content = $page->getContent(); - $this->assertTrue(strpos($page_content, 'Llama block') > 0); + $this->assertTrue(strpos($page_content, 'Llama block') > 0, 'Block found on page.'); + + // Narrow the context to the block that shows the facet and get objects that + // contain the