Skip to content
Snippets Groups Projects

Tests only, do not merge

Open Youri van Koppen requested to merge issue/markdown-3463119:3463119-tests_only into 3.0.x
Files
2
@@ -2,6 +2,8 @@
namespace Drupal\Tests\markdown\Functional;
use Drupal\editor\EditorInterface;
use Drupal\editor\Entity\Editor;
use Drupal\filter\Entity\FilterFormat;
use Drupal\filter\FilterFormatInterface;
use Drupal\markdown\Plugin\Filter\FilterMarkdownInterface;
@@ -60,4 +62,40 @@ class FilterAdminTest extends MarkdownBrowserTestBase {
$this->assertTrue($markdown->isEnabled());
}
/**
* Tests creating a text format using CKEditor without the markdown filter.
*/
public function testCreateTextFormatWithoutMarkdownFilter() {
// Enable the CKEditor5 module.
$this->container->get('module_installer')->install(['ckeditor5']);
// Add text format.
$this->drupalGet('admin/config/content/formats/add');
$format_id = $this->randomMachineName();
$edit = [
'format' => $format_id,
'name' => $this->randomMachineName(),
'editor[editor]' => 'ckeditor5',
];
$this->submitForm($edit, 'Configure');
// Workaround for https://www.drupal.org/project/drupal/issues/3457717.
$edit = [
'editor[settings][toolbar][items]' => '["heading","bold","italic","drupalInsertImage"]',
];
$this->submitForm($edit, 'Configure');
$this->submitForm([], 'Save configuration');
$this->assertSession()->statusCodeEquals(200);
// Check that the filter has been created.
$format = FilterFormat::load($format_id);
$this->assertInstanceof(FilterFormatInterface::class, $format);
// Check that CKEditor5 is enabled for this format.
$editor = Editor::load($format_id);
$this->assertInstanceof(EditorInterface::class, $editor);
$this->assertEquals('ckeditor5', $editor->getEditor());
}
}
Loading