public function JavascriptTest::testSettings in Display Suite 8.2
Same name and namespace in other branches
- 8.4 tests/src/FunctionalJavascript/JavascriptTest.php \Drupal\Tests\ds\FunctionalJavascript\JavascriptTest::testSettings()
- 8.3 tests/src/FunctionalJavascript/JavascriptTest.php \Drupal\Tests\ds\FunctionalJavascript\JavascriptTest::testSettings()
Test DS settings.
File
- tests/
src/ FunctionalJavascript/ JavascriptTest.php, line 62
Class
- JavascriptTest
- Tests javascript behavior for the admin UI.
Namespace
Drupal\Tests\ds\FunctionalJavascriptCode
public function testSettings() {
// Go to the article manage display page.
$this
->drupalGet('admin/structure/types/manage/article/display');
$page = $this
->getSession()
->getPage();
// Change the layout to 2 column layout and wait for it to be changed, see
// if the new template is displayed.
$page
->selectFieldOption('layout', 'ds_2col');
$this
->assertSession()
->assertWaitOnAjaxRequest();
$this
->assertSession()
->pageTextContains('ds-2col--node.html.twig');
$page
->pressButton('Save');
// Check that all settings are saved.
/** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display */
$display = EntityViewDisplay::load('node.article.default');
$settings = $display
->getThirdPartySetting('ds', 'layout');
$this
->assertSame($settings['id'], 'ds_2col');
}