You are here

public function QuickEditLoadingTest::testDisplayOptions in Drupal 10

Same name in this branch
  1. 10 core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditLoadingTest::testDisplayOptions()
  2. 10 core/modules/quickedit/tests/src/Kernel/QuickEditLoadingTest.php \Drupal\Tests\quickedit\Kernel\QuickEditLoadingTest::testDisplayOptions()
Same name and namespace in other branches
  1. 8 core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditLoadingTest::testDisplayOptions()
  2. 9 core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditLoadingTest::testDisplayOptions()

Tests that Quick Edit doesn't make fields rendered with display options editable.

File

core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php, line 254

Class

QuickEditLoadingTest
Tests loading of in-place editing functionality and lazy loading of its in-place editors.

Namespace

Drupal\Tests\quickedit\FunctionalJavascript

Code

public function testDisplayOptions() {
  $node = Node::load('1');
  $display_settings = [
    'label' => 'inline',
  ];
  $build = $node->body
    ->view($display_settings);
  $output = \Drupal::service('renderer')
    ->renderRoot($build);
  $this
    ->assertStringNotContainsString('data-quickedit-field-id', $output, 'data-quickedit-field-id attribute not added when rendering field using dynamic display options.');
}