You are here

public function PanelizerTest::testAvailableBlocks in Lightning Layout 8

Tests that default layouts have expected blocks available.

File

tests/src/Functional/PanelizerTest.php, line 24

Class

PanelizerTest
Tests basic integration with Panelizer.

Namespace

Drupal\Tests\lightning_layout\Functional

Code

public function testAvailableBlocks() {
  $assert_session = $this
    ->assertSession();
  $account = $this
    ->createUser([
    'administer panelizer',
  ]);
  $this
    ->drupalLogin($account);
  $machine_name = 'node__landing_page__full__default';

  // Initialize the tempstore.
  $url = Url::fromRoute('panelizer.wizard.edit', [
    'machine_name' => $machine_name,
  ]);
  $this
    ->drupalGet($url);
  $assert_session
    ->statusCodeEquals(200);

  // View the list of available blocks.
  $url = Url::fromRoute('panels.select_block', [
    'tempstore_id' => 'panelizer.wizard',
    'machine_name' => $machine_name,
  ]);
  $this
    ->drupalGet($url);
  $assert_session
    ->statusCodeEquals(200);
  $assert_session
    ->linkExists('Authored by');
}