$this->
createNewTextFormat($page,
$assert_session);
$assert_session->
assertWaitOnAjaxRequest();
$media_tab =
$page->
find('css', '[href^="#edit-filters-media-embed-settings"]'
);
$this->
assertFalse($media_tab->
isVisible(), 'Media filter settings should not be present because media filter is not enabled'
);
$this->
assertTrue($page->
hasUncheckedField('filters[media_embed][status]'
));
$page->
checkField('filters[media_embed][status]'
);
$assert_session->
assertWaitOnAjaxRequest();
$media_tab =
$assert_session->
waitForElementVisible('css', '[href^="#edit-filters-media-embed-settings"]'
);
$this->
assertTrue($media_tab->
isVisible(), 'Media settings should appear when media filter enabled'
);
$page->
uncheckField('filters[media_embed][status]'
);
$assert_session->
assertWaitOnAjaxRequest();
$media_tab =
$page->
find('css', '[href^="#edit-filters-media-embed-settings"]'
);
$this->
assertFalse($media_tab->
isVisible(), 'Media settings should be removed when media filter disabled'
);
} /**
* Ensure CKEditor 5 admin UI's real-time validation errors do not accumulate.
*/