$assert_session =
$this->
assertSession();
$this->
createNewTextFormat($page,
$assert_session, 'unicorn'
);
$assert_session->
assertWaitOnAjaxRequest();
// Enable the HTML filter.
$this->
assertTrue($page->
hasUncheckedField('filters[filter_html][status]'
));
$page->
checkField('filters[filter_html][status]'
);
$assert_session->
assertWaitOnAjaxRequest();
// Confirm the allowed HTML tags are the defaults initially.
$this->
assertHtmlEsqueFieldValueEquals('filters[filter_html][settings][allowed_html]',
$this->defaultElementsWhenUpdatingNotCkeditor5
);
$this->
saveNewTextFormat($page,
$assert_session);
$assert_session->
pageTextContains('Added text format unicorn'
);
// Return to the config form to confirm that switching text editors on
// existing formats will properly switch allowed tags.
$this->
drupalGet('admin/config/content/formats/manage/unicorn'
);
$assert_session->
assertWaitOnAjaxRequest();
$this->
assertHtmlEsqueFieldValueEquals('filters[filter_html][settings][allowed_html]',
$this->defaultElementsWhenUpdatingNotCkeditor5
);
$page->
selectFieldOption('editor[editor]', 'ckeditor5'
);