diff --git a/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php index 81fe3f8..13b97a5 100644 --- a/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php +++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php @@ -368,12 +368,23 @@ protected function pressToolbarEditButton() { * Tests that title block does not have a outside_in contextual link. */ public function testBlockExcluded() { + $web_assert = $this->assertSession(); $block = $this->placeBlock('page_title_block'); $this->drupalGet('user'); - // Assert that contextual that should exist does. - $this->assertSession()->elementExists('css', "#block-powered [data-outside-in-edit]"); - // Assert that contextual that not should exist does not. - $this->assertSession()->elementNotExists('css', "#block-{$block->id()} [data-outside-in-edit]"); + // Assert that block has been marked as "editable" and contextual that + // should exist does. + $web_assert->elementExists('css', "#block-powered[data-drupal-outsidein=\"editable\"] [data-outside-in-edit]"); + // Check each block that should be excluded. + // We do not need to place the main content block. + // It's ID will just be 'content'. + foreach (["block-{$block->id()}", 'content'] as $excluded_block_id) { + // Assert block itself exists. + $web_assert->elementExists('css', "#$excluded_block_id"); + // Assert that exclude block has not been marked as "editable". + $web_assert->elementNotExists('css', "#{$excluded_block_id}[data-drupal-outsidein=\"editable\"]"); + // Assert that contextual that not should exist does not. + $web_assert->elementNotExists('css', "#$excluded_block_id [data-outside-in-edit]"); + } } }