You are here

public function DrupalNbspTest::testEditorWorksWhenNbspEnabled in CKEditor Non-breaking space Plugin ( ) 8

Same name and namespace in other branches
  1. 8.2 tests/src/FunctionalJavascript/DrupalNbspTest.php \Drupal\Tests\nbsp\FunctionalJavascript\DrupalNbspTest::testEditorWorksWhenNbspEnabled()

Ensure the CKeditor still works when NBSP plugin is enabled.

File

tests/src/FunctionalJavascript/DrupalNbspTest.php, line 142

Class

DrupalNbspTest
Ensure the NBSP CKeditor dialog works.

Namespace

Drupal\Tests\nbsp\FunctionalJavascript

Code

public function testEditorWorksWhenNbspEnabled() {
  $this
    ->drupalGet('node/add/page');
  $this
    ->waitForEditor();
  $this
    ->assignNameToCkeditorIframe();
  $this
    ->getSession()
    ->switchToIFrame('ckeditor');
  $assert_session = $this
    ->assertSession();

  // Ensure CKeditor works properly.
  $this
    ->assertNotEmpty($assert_session
    ->waitForElementVisible('css', '.cke_editable', 1000));

  // Ensure the button NBSP is visible.
  $this
    ->getSession()
    ->switchToIFrame();
  $this
    ->assertNotEmpty($this
    ->assertSession()
    ->waitForElementVisible('css', 'a.cke_button__drupalnbsp'));
}