You are here

public function LayoutBuilderTest::testLayoutBuilderCustomBlockVisibility in Block Style Plugins 8.2

Tests that styles are correctly included/excluded from custom blocks.

File

tests/src/FunctionalJavascript/LayoutBuilderTest.php, line 179

Class

LayoutBuilderTest
Layout Builder tests.

Namespace

Drupal\Tests\block_style_plugins\FunctionalJavascript

Code

public function testLayoutBuilderCustomBlockVisibility() {
  $assert = $this
    ->assertSession();

  // Create the custom block.
  $block = $this
    ->createBlockContent('Custom Block Test');
  $block_css_locator = '.block-block-content' . $block
    ->uuid();
  $this
    ->drupalGet('node/1/layout');

  // Add a new block.
  $this
    ->addNewBlock('Custom Block Test');

  // Click the contextual link.
  $this
    ->clickContextualLink($block_css_locator, 'Style settings');
  $assert
    ->assertWaitOnAjaxRequest();

  // There should not be an option for the excluded style.
  $assert
    ->pageTextContains('Simple Class');
  $assert
    ->pageTextContains('Dropdown with Include');
  $assert
    ->pageTextNotContains('Checkbox with Exclude');
  $assert
    ->pageTextNotContains('Styles Created by Yaml');
}