function CKEditor5AllowedTagsTest::testEnablingToVersion5Validation
Same name in other branches
- 9 core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5AllowedTagsTest.php \Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditor5AllowedTagsTest::testEnablingToVersion5Validation()
- 11.x core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5AllowedTagsTest.php \Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditor5AllowedTagsTest::testEnablingToVersion5Validation()
Test enabling CKEditor 5 in a way that triggers validation.
File
-
core/
modules/ ckeditor5/ tests/ src/ FunctionalJavascript/ CKEditor5AllowedTagsTest.php, line 60
Class
- CKEditor5AllowedTagsTest
- Tests for CKEditor 5.
Namespace
Drupal\Tests\ckeditor5\FunctionalJavascriptCode
public function testEnablingToVersion5Validation() : void {
$page = $this->getSession()
->getPage();
$assert_session = $this->assertSession();
$incompatible_filter_name = 'filters[filter_incompatible][status]';
$filter_warning = 'CKEditor 5 only works with HTML-based text formats. The "A TYPE_MARKUP_LANGUAGE filter incompatible with CKEditor 5" (filter_incompatible) filter implies this text format is not HTML anymore.';
$this->createNewTextFormat($page, $assert_session, 'unicorn');
$page->checkField('filters[filter_html][status]');
$page->checkField($incompatible_filter_name);
$page->selectFieldOption('editor[editor]', 'ckeditor5');
$assert_session->assertExpectedAjaxRequest(2);
$assert_session->pageTextContains($filter_warning);
// Disable the incompatible filter.
$page->uncheckField($incompatible_filter_name);
// Confirm there are no longer any warnings.
$assert_session->waitForElementRemoved('css', '[data-drupal-messages] [role="alert"]');
// Confirm the text format can be saved.
$this->saveNewTextFormat($page, $assert_session);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.