You are here

protected function TestBase::assertEditorOption in Twig Field 8

Assets editor option value.

1 call to TestBase::assertEditorOption()
TestBase::assertWidgetForm in tests/src/FunctionalJavascript/TestBase.php
Asserts widget form.

File

tests/src/FunctionalJavascript/TestBase.php, line 75

Class

TestBase
Base class for Twig field tests.

Namespace

Drupal\Tests\twig_field\FunctionalJavascript

Code

protected function assertEditorOption($option, $expected_value) {
  $script = 'document.querySelector("#edit-field-template-wrapper .CodeMirror").CodeMirror.getOption("%s");';
  $script = sprintf($script, $option);
  $value = $this
    ->getSession()
    ->getDriver()
    ->evaluateScript($script);
  self::assertSame($expected_value, $value);
}