function MoveBlockFormTest::openBodyMoveForm

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

Open block for the body field.

Parameters

int $delta: The section delta where the field should be.

string $region: The region where the field should be.

array $initial_blocks: The initial blocks that should be shown in the draggable table.

1 call to MoveBlockFormTest::openBodyMoveForm()
MoveBlockFormTest::testMoveBlock in core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php
Tests moving a block.

File

core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php, line 288

Class

MoveBlockFormTest
Tests moving blocks via the form.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function openBodyMoveForm($delta, $region, array $initial_blocks) : void {
    $assert_session = $this->assertSession();
    $body_field_locator = "[data-layout-delta=\"{$delta}\"] [data-region=\"{$region}\"] .block-field-blocknodebundle-with-section-fieldbody";
    $this->clickContextualLink($body_field_locator, 'Move');
    $assert_session->assertWaitOnAjaxRequest();
    $this->assertNotEmpty($assert_session->waitForElementVisible('named', [
        'select',
        'Region',
    ]));
    $assert_session->fieldValueEquals('Region', "{$delta}:{$region}");
    $this->assertBlockTable($initial_blocks);
}

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