protected function TestBase::assertScrollerMinHeight in The CodeMirror Editor 8
Assets editor scroller min height.
1 call to TestBase::assertScrollerMinHeight()
- EditorTest::testEditor in tests/
src/ FunctionalJavascript/ EditorTest.php - Test callback.
File
- tests/
src/ FunctionalJavascript/ TestBase.php, line 121
Class
- TestBase
- Base class for CodeMirror editor tests.
Namespace
Drupal\Tests\codemirror_editor\FunctionalJavascriptCode
protected function assertScrollerMinHeight($expected_height) {
$script = 'document.querySelector("%s .CodeMirror .CodeMirror-scroll").style.minHeight;';
$script = sprintf($script, $this
->getWrapperSelector());
$height = (int) $this
->getSession()
->getDriver()
->evaluateScript($script);
self::assertLessThan(5, abs($expected_height - $height));
}