diff --git a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php index 131a9ce910..cc4dc0ba94 100644 --- a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php +++ b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php @@ -50,6 +50,7 @@ protected function setUp(): void { $this->adminUser = $this->drupalCreateUser([ 'administer content types', 'administer nodes', + 'bypass node access', 'administer blocks', 'access content overview', ]); @@ -184,6 +185,11 @@ public function testRecentNodeBlock() { $this->assertSame('HIT', $this->getSession()->getResponseHeader('X-Drupal-Dynamic-Cache')); $this->drupalLogin($this->adminUser); + + // Assert that the preview page displays the block as well. + $this->drupalPostForm('node/' . $node1->id() . '/edit', [], t('Preview')); + $this->assertSession()->pageTextContains($label); + $this->drupalGet('admin/structure/block'); $this->assertText($label, 'Block was displayed on the admin/structure/block page.'); $this->assertLinkByHref($block->toUrl()->toString());