You are here

protected function TestBase::assertEditorValue in Twig Field 8

Assets editor value.

1 call to TestBase::assertEditorValue()
TwigFieldTest::testTwigField in tests/src/FunctionalJavascript/TwigFieldTest.php
Test callback.

File

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

Class

TestBase
Base class for Twig field tests.

Namespace

Drupal\Tests\twig_field\FunctionalJavascript

Code

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