function ContextualLinksTest::assertCorrectContextualLinksInUi

Same name in other branches
  1. 9 core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\ContextualLinksTest::assertCorrectContextualLinksInUi()
  2. 10 core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\ContextualLinksTest::assertCorrectContextualLinksInUi()
  3. 11.x core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\ContextualLinksTest::assertCorrectContextualLinksInUi()

Asserts the contextual links are correct in Layout Builder UI.

1 call to ContextualLinksTest::assertCorrectContextualLinksInUi()
ContextualLinksTest::testContextualLinks in core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php
Tests that the contextual links inside Layout Builder are removed.

File

core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php, line 127

Class

ContextualLinksTest
Test contextual links compatibility with the Layout Builder.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function assertCorrectContextualLinksInUi() {
    $assert_session = $this->assertSession();
    $page = $this->getSession()
        ->getPage();
    $this->assertNotEmpty($assert_session->waitForElementVisible('css', '.block-views-blocktest-block-view-block-2'));
    $layout_builder_specific_contextual_links = $page->findAll('css', '[data-contextual-id*=\'layout_builder_block:\']');
    $this->assertNotEmpty($layout_builder_specific_contextual_links);
    // Confirms Layout Builder contextual links are the only contextual links
    // inside the Layout Builder UI.
    $this->assertSameSize($layout_builder_specific_contextual_links, $page->findAll('css', '#layout-builder [data-contextual-id]'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.