You are here

protected function MoveBlockHelperTrait::assertBlockTable in Layout Builder Restrictions 8.2

Asserts the correct block labels appear in the draggable tables.

Parameters

string[] $expected_block_labels: The expected block labels.

6 calls to MoveBlockHelperTrait::assertBlockTable()
MoveBlockBlacklistTest::testMovePluginBlock in modules/layout_builder_restrictions_by_region/tests/src/FunctionalJavascript/MoveBlockBlacklistTest.php
Tests moving a plugin block.
MoveBlockHelperTrait::moveBlockWithKeyboard in tests/src/Traits/MoveBlockHelperTrait.php
Moves a block in the draggable table.
MoveBlockHelperTrait::openMoveForm in tests/src/Traits/MoveBlockHelperTrait.php
Open block for the body field.
MoveBlockRestrictionTest::testLayoutLibraryMovePluginBlock in tests/src/FunctionalJavascript/MoveBlockRestrictionTest.php
Move a plugin block in the Layout Library.
MoveBlockRestrictionTest::testMovePluginBlock in tests/src/FunctionalJavascript/MoveBlockRestrictionTest.php
Tests moving a plugin block.

... See full list

File

tests/src/Traits/MoveBlockHelperTrait.php, line 20

Class

MoveBlockHelperTrait
General-purpose methods for moving blocks in Layout Builder.

Namespace

Drupal\Tests\layout_builder_restrictions\Traits

Code

protected function assertBlockTable(array $expected_block_labels) {
  $page = $this
    ->getSession()
    ->getPage();
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $block_tds = $page
    ->findAll('css', '.layout-builder-components-table__block-label');
  $this
    ->assertCount(count($block_tds), $expected_block_labels);

  /** @var \Behat\Mink\Element\NodeElement $block_td */
  foreach ($block_tds as $block_td) {
    $this
      ->assertSame(array_shift($expected_block_labels), trim($block_td
      ->getText()));
  }
}