$assert_session =
$this->
assertSession();
$this->
createNewTextFormat($page,
$assert_session);
$assert_session->
assertWaitOnAjaxRequest();
// Confirm the "allowed tags" field is read only, and the value
// matches the tags required by CKEditor.
// Allowed HTML field is readonly and its wrapper has a form-disabled class.
$this->
assertNotEmpty($assert_session->
waitForElement('css', '.js-form-item-filters-filter-html-settings-allowed-html.form-disabled'
));
$allowed_html_field =
$assert_session->
fieldExists('filters[filter_html][settings][allowed_html]'
);
$this->
assertTrue($allowed_html_field->
hasAttribute('readonly'
));
$this->
assertSame($this->allowedElements,
$allowed_html_field->
getValue());
$this->
saveNewTextFormat($page,
$assert_session);
$assert_session->
pageTextContains('Added text format ckeditor5'
);
$assert_session->
pageTextContains('Text formats and editors'
);
// Confirm the filter config was updated with the correct allowed tags.
$this->
assertSame($this->allowedElements, FilterFormat::
load('ckeditor5'
)->
filters('filter_html'
)->
getConfiguration()['settings'
]['allowed_html'
]);
$page->
find('css', '[data-drupal-selector="edit-formats-ckeditor5"]'
)->
clickLink('Configure'
);
$assert_session->
assertWaitOnAjaxRequest();