You are here

protected function BlockListElementsTest::assertBlockElementsNotExists in Block permissions 8

Asserts that block configuration elements don't exist.

Parameters

string $id: Block id.

1 call to BlockListElementsTest::assertBlockElementsNotExists()
BlockListElementsTest::testBlockListPage in tests/src/Functional/BlockListElementsTest.php
Tests configuration elements on the block list page.

File

tests/src/Functional/BlockListElementsTest.php, line 98

Class

BlockListElementsTest
Tests visibility of configuration elements on the block_admin_display_form.

Namespace

Drupal\Tests\block_permissions\Functional

Code

protected function assertBlockElementsNotExists($id) {
  $row = $this
    ->assertSession()
    ->elementExists('css', "tr[data-drupal-selector=\"edit-blocks-{$id}\"]");

  // Configurations dropbutton doesn't exists.
  $this
    ->assertSession()
    ->elementNotExists('css', 'ul.dropbutton', $row);

  // Weight selector doesn't exists.
  $this
    ->assertSession()
    ->elementNotExists('css', 'select.block-weight', $row);

  // Region selector doesn't exist.
  $this
    ->assertSession()
    ->elementNotExists('css', 'select.block-region-select', $row);

  // Draggable element doesn't exists.
  $this
    ->assertStringContainsString('undraggable', $row
    ->getAttribute('class'));
}