Problem/Motivation

Add missing test coverage: CKE5's SmartDefaultSettings in the "supported tags but unsupported attributes" case works, but has zero test coverage.

Discovered this while working on #3228334: Refactor HTMLRestrictionsUtilities to a HtmlRestrictions value object. This issue blocks that! This is test coverage we forgot to introduce in #3216015: Generate CKEditor 5 configuration based on pre-existing text format configuration.

Steps to reproduce

N/A

Proposed resolution

Expand test coverage.

Note that we specifically do not attempt to improve the upgrade path here, only to add test coverage to prove that existing code works reasonably well.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

CommentFileSizeAuthor
#16 3259174-16-9.3.x.patch5.44 KBWim Leers
#16 3259174-16-9.4.x_and_10.0.x.patch5.44 KBWim Leers
#16 interdiff.txt2.28 KBWim Leers
#12 3259174-12-9.3.x.patch5.34 KBhooroomoo
#11 3259174-11-9.4.x_10.0.x.patch5.33 KBhooroomoo
#10 3259174-6-9.3.x.patch5.34 KBhooroomoo
#10 3259174-6-9.4.x_and_10.0.x.patch5.33 KBhooroomoo
#9 3259174-6-9.3.x.patch5.33 KBhooroomoo
#9 3259174-6-9.4.x_and_10.0.x.patch5.33 KBhooroomoo
#6 3259174-6-9.3.x.patch5.31 KBWim Leers
#6 3259174-6-9.4.x_and_10.0.x.patch5.31 KBWim Leers
#4 3259174-4-9.3.x.patch5.32 KBWim Leers
#3 interdiff.txt291 bytesWim Leers
#6 interdiff.txt1.27 KBWim Leers
#3 3259174-3.patch5.32 KBWim Leers
#2 3259174-2.patch5.04 KBWim Leers
#4 3259174-4-9.4.x_and_10.0.x.patch5.32 KBWim Leers
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers created an issue. See original summary.

Wim Leers’s picture

Wim Leers’s picture

Wim Leers’s picture

The patch in #3 did not apply to 9.3.x, only due to the dictionary being different in 9.3.x.

Here's the same patch uploaded again for 9.4.x and 10.0.x and a different patch for 9.3.x.

lauriii’s picture

+++ b/core/modules/ckeditor5/tests/src/Kernel/SmartDefaultSettingsTest.php
@@ -456,6 +468,55 @@ public function provider() {
+        // @todo Avoid allowing alignment on other tags, blocked on upstream: https://github.com/ckeditor/ckeditor5/issues/11131

I think we should open an issue in our issue queue to track the upstream issue, and link it here.

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, thank you!

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/ckeditor5/tests/src/Kernel/SmartDefaultSettingsTest.php
@@ -456,6 +468,55 @@ public function provider() {
+        // @todo Improve this in https://www.drupal.org/project/drupal/issues/3231328
+        '<p class="text-align-left text-align-right">',
+        // Note that aligning left/center/right/justify is possible on *all*
+        // allowed block-level HTML5 tags.
+        // @todo When https://www.drupal.org/project/ckeditor5/issues/3231328 lands, only the center/justify classes will be added.
+        // @todo When https://www.drupal.org/project/drupal/issues/3259367 lands, none of the tags below should appear.

This is such a nit that my dog is concerned about my visible embarrassment. These three @todo items exceed the 80 char limit. They should be extended to additional lines with a two space indent to indicate they're a continuation of the @todo

hooroomoo’s picture

Uploaded same patches in #6 with added indents

hooroomoo’s picture

hooroomoo’s picture

The last submitted patch, 11: 3259174-11-9.4.x_10.0.x.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 12: 3259174-12-9.3.x.patch, failed testing. View results

bnjmnm’s picture

+++ b/core/modules/ckeditor5/tests/src/Kernel/SmartDefaultSettingsTest.php
@@ -456,6 +468,57 @@ public function provider() {
+            // @todo Improve in https://www.drupal.org/project/drupal/issues/3259179

Issue 3259179 landed earlier today, the changes introduced there makes this test outdated as the alignment operations have been split into individual plugins so enabling one does not automatically enable the others.

Wim Leers’s picture

This is such a nit that my dog is concerned about my visible embarrassment.

🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣

Rebased now that #3259179: Split ckeditor5_alignment CKEditor 5 plugin, to allow for more precise upgrade path is in 👍 And now we have #3259593: Alignment being available as separate buttons AND in dropdown is confusing, which is the next way that this test coverage can be refined.

  • bnjmnm committed 0466cba on 9.3.x
    Issue #3259174 by Wim Leers, lauriii, hooroomoo, bnjmnm: Add missing...

  • bnjmnm committed 0722b46 on 10.0.x
    Issue #3259174 by Wim Leers, lauriii, hooroomoo, bnjmnm: Add missing...

  • bnjmnm committed 9df7f5a on 9.4.x
    Issue #3259174 by Wim Leers, lauriii, hooroomoo, bnjmnm: Add missing...
bnjmnm’s picture

Status: Reviewed & tested by the community » Fixed

This is now current with #3259179: Split ckeditor5_alignment CKEditor 5 plugin, to allow for more precise upgrade path so it's merged to 9.4.x/10.0.x as well as 9.3.x since CKEditor 5 is experimental and this is a non-disruptive expansion of test coverage.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.