public function LayoutBuilderUiTest::testUnsavedChangesMessage in Drupal 9
Same name and namespace in other branches
- 8 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderUiTest::testUnsavedChangesMessage()
Tests the message indicating unsaved changes.
File
- core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ LayoutBuilderUiTest.php, line 87
Class
- LayoutBuilderUiTest
- Tests the Layout Builder UI.
Namespace
Drupal\Tests\layout_builder\FunctionalJavascriptCode
public function testUnsavedChangesMessage() {
$assert_session = $this
->assertSession();
$page = $this
->getSession()
->getPage();
// Make and then discard changes.
$this
->assertModifiedLayout(static::FIELD_UI_PREFIX . '/display/default/layout');
$page
->pressButton('Discard changes');
$page
->pressButton('Confirm');
$assert_session
->pageTextNotContains('You have unsaved changes.');
// Make and then save changes.
$this
->assertModifiedLayout(static::FIELD_UI_PREFIX . '/display/default/layout');
$page
->pressButton('Save layout');
$assert_session
->pageTextNotContains('You have unsaved changes.');
}