public function PanelizerTest::testResave in Lightning Layout 8
File
- tests/src/FunctionalJavascript/PanelizerTest.php, line 82
Class
- PanelizerTest
- @group lightning_layout
Namespace
Drupal\Tests\lightning_layout\FunctionalJavascript
Code
public function testResave() {
$account = $this
->drupalCreateUser([
'create landing_page content',
'edit own landing_page content',
'access panels in-place editing',
'administer panelizer node landing_page content',
'access user profiles',
]);
$this
->drupalLogin($account);
$block_selector = '[data-block-plugin-id="views_block:who_s_online-who_s_online_block"]';
$node = $this
->drupalCreateNode([
'type' => 'landing_page',
'uid' => $account
->id(),
]);
$this
->drupalGet($node
->toUrl());
$this
->assertSession()
->elementExists('css', '#panels-ipe-content');
$this
->assertSession()
->elementNotExists('css', '.field--name-uid');
$this
->assertSession()
->elementNotExists('css', '.field--name-created');
$this
->getBlockForm('views_block:who_s_online-who_s_online_block', 'Lists (Views)')
->pressButton('Add');
$this
->assertNotEmpty($this
->assertSession()
->waitForElement('css', $block_selector));
$this
->getTray()
->clickLink('Save');
$this
->assertSession()
->assertWaitOnAjaxRequest();
$this
->drupalGet($node
->toUrl('edit-form'));
$this
->assertTrue($this
->assertSession()
->selectExists('Full content')
->hasAttribute('disabled'));
$this
->assertSession()
->buttonExists('Save')
->press();
$this
->assertSession()
->elementExists('css', $block_selector);
}