You are here

public function IpeQuickEditTest::testQuickEditInIpe in Lightning Layout 8

Tests quick-editing fields placed in an IPE layout.

File

tests/src/FunctionalJavascript/IpeQuickEditTest.php, line 29

Class

IpeQuickEditTest
@group lightning_layout @group orca_public

Namespace

Drupal\Tests\lightning_layout\FunctionalJavascript

Code

public function testQuickEditInIpe() {
  $user = $this
    ->drupalCreateUser([], NULL, TRUE);
  $page = $this
    ->drupalCreateNode([
    'type' => 'landing_page',
    'body' => [
      [
        'value' => 'How quickly deft jumping zebras vex.',
        'format' => filter_default_format(),
      ],
    ],
  ]);
  $this
    ->drupalLogin($user);
  $this
    ->drupalGet($page
    ->toUrl());

  // Add a body block to the layout.
  $this
    ->getBlockForm('entity_field:node:body', 'Content')
    ->pressButton('Add');
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->saveLayout();

  // Assert the quickedit contextual link is present.
  $this
    ->getSession()
    ->reload();
  $link = $this
    ->assertSession()
    ->waitForElement('css', '[data-quickedit-entity-id="node/1"].contextual-region ul.contextual-links li.quickedit');
  $this
    ->assertNotNull($link);
}