Jelajahi Sumber

Restored removed test, added a new one and fixed test case name.

Kamil Piechaczek 8 tahun lalu
induk
melakukan
7cee137905

+ 12 - 0
packages/ckeditor5-engine/tests/controller/deletecontent.js

@@ -233,6 +233,12 @@ describe( 'DataController', () => {
 				'<heading1>f[]</heading1><paragraph>x</paragraph>'
 				'<heading1>f[]</heading1><paragraph>x</paragraph>'
 			);
 			);
 
 
+			test(
+				'leaves just one element when all selected',
+				'<heading1>[x</heading1><paragraph>foo</paragraph><paragraph>y]bar</paragraph>',
+				'<heading1>[]bar</heading1>'
+			);
+
 			it( 'uses remove delta instead of merge delta if merged element is empty', () => {
 			it( 'uses remove delta instead of merge delta if merged element is empty', () => {
 				setData( doc, '<paragraph>ab[cd</paragraph><paragraph>efgh]</paragraph>' );
 				setData( doc, '<paragraph>ab[cd</paragraph><paragraph>efgh]</paragraph>' );
 
 
@@ -699,6 +705,12 @@ describe( 'DataController', () => {
 				'<paragraph>[]</paragraph>'
 				'<paragraph>[]</paragraph>'
 			);
 			);
 
 
+			test(
+				'when the entire content was selected',
+				'<heading1>[x</heading1><paragraph>foo</paragraph><paragraph>y]</paragraph>',
+				'<paragraph>[]</paragraph>'
+			);
+
 			test(
 			test(
 				'inside the limit element when the entire heading and paragraph were inside',
 				'inside the limit element when the entire heading and paragraph were inside',
 				'<div><heading1>[xx</heading1><paragraph>yy]</paragraph></div>',
 				'<div><heading1>[xx</heading1><paragraph>yy]</paragraph></div>',

+ 1 - 1
packages/ckeditor5-engine/tests/model/schema/schema.js

@@ -49,7 +49,7 @@ describe( 'Schema', () => {
 			expect( schema.limits ).to.be.instanceOf( Set );
 			expect( schema.limits ).to.be.instanceOf( Set );
 		} );
 		} );
 
 
-		it( 'should have defined the limits elements', () => {
+		it( 'should mark $root as a limit element', () => {
 			expect( schema.limits.has( '$root' ) ).to.be.true;
 			expect( schema.limits.has( '$root' ) ).to.be.true;
 		} );
 		} );