You are here

protected function ContextualLinksTest::assertCorrectContextualLinksInUi in Drupal 9

Same name and namespace in other branches
  1. 8 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]'));
}