Przeglądaj źródła

Adds tests for checking "forward delete" with an element and widget next to.

Kamil Piechaczek 8 lat temu
rodzic
commit
88713976d6
1 zmienionych plików z 31 dodań i 0 usunięć
  1. 31 0
      packages/ckeditor5-widget/tests/widget.js

+ 31 - 0
packages/ckeditor5-widget/tests/widget.js

@@ -508,6 +508,21 @@ describe( 'Widget', () => {
 			);
 
 			test(
+				'should remove the entire empty element (deeper structure) if it is next to a widget (forward delete)',
+
+				'<paragraph>foo</paragraph>' +
+				'<blockQuote><div><div><paragraph>[]</paragraph></div></div></blockQuote>' +
+				'<image></image>' +
+				'<paragraph>foo</paragraph>',
+
+				keyCodes.delete,
+
+				'<paragraph>foo</paragraph>' +
+				'[<image></image>]' +
+				'<paragraph>foo</paragraph>'
+			);
+
+			test(
 				'should not remove the entire element which is not empty and the element is next to a widget',
 
 				'<paragraph>foo</paragraph>' +
@@ -524,6 +539,22 @@ describe( 'Widget', () => {
 			);
 
 			test(
+				'should not remove the entire element which is not empty and the element is next to a widget (forward delete)',
+
+				'<paragraph>foo</paragraph>' +
+				'<blockQuote><paragraph>Foo</paragraph><paragraph>[]</paragraph></blockQuote>' +
+				'<image></image>' +
+				'<paragraph>foo</paragraph>',
+
+				keyCodes.delete,
+
+				'<paragraph>foo</paragraph>' +
+				'<blockQuote><paragraph>Foo</paragraph></blockQuote>' +
+				'[<image></image>]' +
+				'<paragraph>foo</paragraph>'
+			);
+
+			test(
 				'should not remove the entire element (deeper structure) which is not empty and the element is next to a widget',
 
 				'<paragraph>foo</paragraph>' +