Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / block_content / tests / src / Functional / BlockContentListTest.php
index aba60c366c629158b87840b6596aea7b1e72efd5..8919c05d00193c6354d84979aaa116725d35f1ce 100644 (file)
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\block_content\Functional;
 
+use Drupal\block_content\Entity\BlockContent;
+
 /**
  * Tests the listing of custom blocks.
  *
@@ -103,7 +105,20 @@ class BlockContentListTest extends BlockContentTestBase {
     $this->assertNoFieldByXpath('//td', $new_label, 'No label found for deleted custom block.');
 
     // Confirm that the empty text is displayed.
-    $this->assertText(t('There is no Custom block yet.'));
+    $this->assertText(t('There are no custom blocks yet.'));
+
+    $block_content = BlockContent::create([
+      'info' => 'Non-reusable block',
+      'type' => 'basic',
+      'reusable' => FALSE,
+    ]);
+    $block_content->save();
+
+    $this->drupalGet('admin/structure/block/block-content');
+    // Confirm that the empty text is displayed.
+    $this->assertSession()->pageTextContains('There are no custom blocks yet.');
+    // Confirm the non-reusable block is not on the page.
+    $this->assertSession()->pageTextNotContains('Non-reusable block');
   }
 
 }