You are here

public function UiDialogTest::testWhenImageNotEnabled in Editor Advanced Image 8

Same name and namespace in other branches
  1. 8.2 tests/src/FunctionalJavascript/UiDialogTest.php \Drupal\Tests\editor_advanced_image\FunctionalJavascript\UiDialogTest::testWhenImageNotEnabled()

Ensure the CKeditor still works when DrupalImage is not in Toolbar.

File

tests/src/FunctionalJavascript/UiDialogTest.php, line 289

Class

UiDialogTest
Tests event info pages and links.

Namespace

Drupal\Tests\editor_advanced_image\FunctionalJavascript

Code

public function testWhenImageNotEnabled() {

  // Add a default class in the settings.
  $settings = [
    'toolbar' => [
      'rows' => [
        [
          [
            'name' => 'All the things',
            'items' => [
              'Source',
              'Bold',
              'Italic',
              'DrupalLink',
              'DrupalUnlink',
            ],
          ],
        ],
      ],
    ],
    'plugins' => [],
  ];
  $this->editor
    ->setSettings($settings);
  $this->editor
    ->save();
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('node/add/page');
  $this
    ->waitForEditor();
  $this
    ->assignNameToCkeditorIframe();
  $this
    ->getSession()
    ->switchToIFrame('ckeditor');
  $assert_session = $this
    ->assertSession();
  $this
    ->assertTrue($assert_session
    ->waitForElementVisible('css', '.cke_editable', 1000));
}