function ContentPreviewToggleTest::assertContextualLinks

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

Checks if contextual links are working properly.

@internal

1 call to ContentPreviewToggleTest::assertContextualLinks()
ContentPreviewToggleTest::testContentPreviewToggle in core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php
Tests the content preview toggle.

File

core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php, line 128

Class

ContentPreviewToggleTest
Tests toggling of content preview.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function assertContextualLinks() : void {
    $page = $this->getSession()
        ->getPage();
    $assert_session = $this->assertSession();
    $this->clickContextualLink('.block-field-blocknodebundle-for-this-particular-testbody', 'Configure');
    $this->waitForOffCanvasArea();
    $this->assertSession()
        ->assertWaitOnAjaxRequest();
    $this->assertNotEmpty($this->assertSession()
        ->waitForButton('Close'));
    $page->pressButton('Close');
    $assert_session->assertNoElementAfterWait('css', '#drupal-off-canvas');
}

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