You are here

public function TempstoreKeyUpdatePathTest::testRunUpdates in Drupal 8

Tests the upgrade path for Layout Builder extra fields.

File

core/modules/layout_builder/tests/src/Functional/Update/TempstoreKeyUpdatePathTest.php, line 31

Class

TempstoreKeyUpdatePathTest
Tests the upgrade path for Layout Builder tempstore keys.

Namespace

Drupal\Tests\layout_builder\Functional\Update

Code

public function testRunUpdates() {
  $page = $this
    ->getSession()
    ->getPage();
  $assert_session = $this
    ->assertSession();
  $this
    ->runUpdates();
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'configure any layout',
    'administer node display',
  ]));
  $this
    ->drupalGet('node/1');
  $assert_session
    ->elementExists('css', '.layout--onecol');
  $assert_session
    ->elementNotExists('css', '.layout--twocol-section');
  $page
    ->clickLink('Layout');
  $assert_session
    ->pageTextContains('You have unsaved changes.');
  $assert_session
    ->elementNotExists('css', '.layout--onecol');
  $assert_session
    ->elementExists('css', '.layout--twocol-section');
}