You are here

public function MiniLayoutsIntegrationTest::testMiniLayoutsWithRestrictionsEnabled in Layout Builder Restrictions 8.2

Verify that Layout Builder Restrictions does not break Mini Layouts.

File

tests/src/FunctionalJavascript/MiniLayoutsIntegrationTest.php, line 41

Class

MiniLayoutsIntegrationTest
Demonstrate that Layout Builder Restrictions works with Mini Layouts.

Namespace

Drupal\Tests\layout_builder_restrictions\FunctionalJavascript

Code

public function testMiniLayoutsWithRestrictionsEnabled() {
  $assert_session = $this
    ->assertSession();
  $page = $this
    ->getSession()
    ->getPage();
  $this
    ->drupalGet('admin/structure/mini_layouts/add');
  $page
    ->fillField('Administrative Label', 'Charlie');
  $this
    ->assertNotEmpty($assert_session
    ->waitForText('Machine name: charlie'));
  $page
    ->fillField('Label', 'Bravo');
  $this
    ->assertNotEmpty($assert_session
    ->waitForText('Machine name: bravo'));
  $page
    ->pressButton('Save');
  $this
    ->drupalGet('admin/structure/mini_layouts/manage/charlie/layout');
  $page
    ->clickLink('Add section');
  $this
    ->assertNotEmpty($assert_session
    ->waitForElementVisible('css', '.layout-selection'));
  $page
    ->clickLink('One column');
  $this
    ->assertNotEmpty($assert_session
    ->waitForText('Configure section'));
  $page
    ->pressButton('Add section');
  $this
    ->assertNotEmpty($assert_session
    ->waitForText('You have unsaved changes'));
  $page
    ->clickLink('Add block');
  $this
    ->assertNotEmpty($assert_session
    ->waitForText('Choose a block'));
}