You are here

protected function MoveBlockFormTest::openBodyMoveForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\MoveBlockFormTest::openBodyMoveForm()
  2. 9 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.

File

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

Class

MoveBlockFormTest
Tests moving blocks via the form.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function openBodyMoveForm($delta, $region, array $initial_blocks) {
  $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);
}