You are here

private function EmbeddedMediaTest::assertEditor in Lightning Media 8.3

Asserts that a CKEditor instance exists and is fully loaded.

Parameters

string $id: (optional) The editor instance ID. Defaults to the first available instance.

Return value

string A snippet of JavaScript for calling instance methods.

1 call to EmbeddedMediaTest::assertEditor()
EmbeddedMediaTest::executeEditorCommand in tests/src/FunctionalJavascript/EmbeddedMediaTest.php
Executes a CKEditor command.

File

tests/src/FunctionalJavascript/EmbeddedMediaTest.php, line 168

Class

EmbeddedMediaTest
Tests embedding media items in CKEditor using the media browser.

Namespace

Drupal\Tests\lightning_media\FunctionalJavascript

Code

private function assertEditor($id = NULL) {
  $id = $id ?: $this
    ->getDefaultEditor();
  $js = "CKEDITOR.instances['{$id}']";
  $this
    ->assertJsCondition("{$js}.status === 'ready'");
  return $js;
}