FilterHtmlTest.php in Drupal 9
File
core/modules/filter/tests/src/FunctionalJavascript/FilterHtmlTest.php
View source
<?php
namespace Drupal\Tests\filter\FunctionalJavascript;
use Drupal\filter\Entity\FilterFormat;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
class FilterHtmlTest extends WebDriverTestBase {
protected static $modules = [
'editor',
'filter',
];
protected $defaultTheme = 'stark';
public function testTableTags() {
FilterFormat::create([
'format' => 'some_html',
'filters' => [
'filter_html' => [
'status' => 1,
'settings' => [
'allowed_html' => '<caption> <tbody> <thead> <tfoot> <th> <td> <tr>',
],
],
],
])
->save();
$this
->drupalLogin($this
->drupalCreateUser([
'administer filters',
]));
$this
->drupalGet('admin/config/content/formats/manage/some_html');
$js_condition = "Drupal.behaviors.filterFilterHtmlUpdating._parseSetting(\n jQuery('#edit-filters-filter-html-settings-allowed-html').val()\n )['td'].tags.length >= 0";
$this
->assertJsCondition($js_condition);
}
}