You are here

public function LayoutLibraryIntegrationTest::testLayoutLibraryWithRestrictionsEnabled in Layout Builder Restrictions 8.2

Same name and namespace in other branches
  1. 8 tests/src/FunctionalJavascript/LayoutLibraryIntegrationTest.php \Drupal\Tests\layout_builder_restrictions\FunctionalJavascript\LayoutLibraryIntegrationTest::testLayoutLibraryWithRestrictionsEnabled()

Verify that Layout Builder Restrictions does not break Layout Library.

File

tests/src/FunctionalJavascript/LayoutLibraryIntegrationTest.php, line 45

Class

LayoutLibraryIntegrationTest
Demonstrate that Layout Builder Restrictions works with Layout Library.

Namespace

Drupal\Tests\layout_builder_restrictions\FunctionalJavascript

Code

public function testLayoutLibraryWithRestrictionsEnabled() {
  $assert_session = $this
    ->assertSession();
  $page = $this
    ->getSession()
    ->getPage();
  $this
    ->drupalGet(Url::fromRoute('entity.layout.add_form'));
  $page
    ->fillField('Label', 'Charlie');
  $this
    ->assertNotEmpty($assert_session
    ->waitForText('Machine name: charlie'));
  $page
    ->selectFieldOption('Entity Type', 'node:alpha');
  $page
    ->pressButton('Save');
  $page
    ->clickLink('Add section');
  $this
    ->assertNotEmpty($assert_session
    ->waitForElementVisible('css', '.layout-selection'));
  $page
    ->clickLink('One column');
  $this
    ->assertNotEmpty($assert_session
    ->waitForText('Configure section'));
}