Przeglądaj źródła

Revert "Added tests to view writer checking integration with WidgetElement."

This reverts commit a363203e89911d921030be36bc67dafab5cbe2f6.
Szymon Kupś 9 lat temu
rodzic
commit
12e370f5ae

+ 0 - 24
packages/ckeditor5-engine/tests/view/writer/breakAttributes.js

@@ -250,30 +250,6 @@ describe( 'writer', () => {
 					breakAttributes( range );
 				} ).to.throw( CKEditorError, 'view-writer-cannot-break-empty-element' );
 			} );
-
-			it( 'should break inside WidgetElement', () => {
-				test(
-					'<widget:figure><attribute:b>foo{}bar</attribute:b></widget:figure>',
-					'<widget:figure contenteditable="false">' +
-						'<attribute:b>foo</attribute:b>' +
-						'[]' +
-						'<attribute:b>bar</attribute:b>' +
-					'</widget:figure>'
-				);
-			} );
-
-			it( 'should stop breaking at WidgetElement', () => {
-				test(
-					'<container:p><widget:figure><attribute:b>foo{}bar</attribute:b></widget:figure></container:p>',
-					'<container:p>' +
-						'<widget:figure contenteditable="false">' +
-							'<attribute:b>foo</attribute:b>' +
-							'[]' +
-							'<attribute:b>bar</attribute:b>' +
-						'</widget:figure>' +
-					'</container:p>'
-				);
-			} );
 		} );
 	} );
 } );

+ 0 - 9
packages/ckeditor5-engine/tests/view/writer/breakContainer.js

@@ -9,7 +9,6 @@ import { breakContainer } from 'ckeditor5/engine/view/writer.js';
 import { stringify, parse } from 'ckeditor5/engine/dev-utils/view.js';
 import CKEditorError from 'ckeditor5/utils/ckeditorerror.js';
 import ContainerElement from 'ckeditor5/engine/view/containerelement.js';
-import WidgetElement from 'ckeditor5/engine/view/widgetelement.js';
 import Position from 'ckeditor5/engine/view/position.js';
 
 describe( 'writer', () => {
@@ -77,13 +76,5 @@ describe( 'writer', () => {
 				breakContainer( position );
 			} ).to.throw( CKEditorError, /view-writer-break-root/ );
 		} );
-
-		it( 'should not allow to break WidgetElement', () => {
-			const widget = new WidgetElement( 'figure' );
-			const position = new Position( widget, 0 );
-			expect( () => {
-				breakContainer( position );
-			} ).to.throw( CKEditorError, 'view-writer-break-non-container-element' );
-		} );
 	} );
 } );

+ 0 - 8
packages/ckeditor5-engine/tests/view/writer/insert.js

@@ -195,13 +195,5 @@ describe( 'writer', () => {
 				insert( position, attributeElement );
 			} ).to.throw( CKEditorError, 'view-writer-cannot-break-empty-element' );
 		} );
-
-		it( 'should allow to insert to the WidgetElement', () => {
-			test(
-				'<widget:figure>[]</widget:figure>',
-				[ '<attribute:b>foo bar</attribute:b>' ],
-				'<widget:figure contenteditable="false">[<attribute:b view-priority="10">foo bar</attribute:b>]</widget:figure>'
-			);
-		} );
 	} );
 } );

+ 0 - 18
packages/ckeditor5-engine/tests/view/writer/mergeAttributes.js

@@ -136,23 +136,5 @@ describe( 'writer', () => {
 				'<container:p><empty:img></empty:img>[]<empty:img></empty:img></container:p>'
 			);
 		} );
-
-		it( 'should merge inside WidgetElement', () => {
-			test(
-				'<widget:figure><attribute:b>foo</attribute:b>[]<attribute:b>bar</attribute:b></widget:figure>',
-				'<widget:figure contenteditable="false">' +
-					'<attribute:b view-priority="10">foo{}bar</attribute:b>' +
-				'</widget:figure>'
-			);
-		} );
-
-		it( 'should not merge WidgetElements', () => {
-			test(
-				'<widget:figure>foo</widget:figure>[]<widget:figure>bar</widget:figure>',
-				'<widget:figure contenteditable="false">foo</widget:figure>' +
-				'[]' +
-				'<widget:figure contenteditable="false">bar</widget:figure>'
-			);
-		} );
 	} );
 } );

+ 0 - 9
packages/ckeditor5-engine/tests/view/writer/mergeContainers.js

@@ -83,14 +83,5 @@ describe( 'writer', () => {
 				mergeContainers( selection.getFirstPosition() );
 			} ).to.throw( CKEditorError, /view-writer-merge-containers-invalid-position/ );
 		} );
-
-		it( 'should throw if trying to merge WidgetElements', () => {
-			const input = '<widget:figure></widget:figure>[]<widget:figure></widget:figure>';
-			const { selection } = parse( input );
-
-			expect( () => {
-				mergeContainers( selection.getFirstPosition() );
-			} ).to.throw( CKEditorError, 'view-writer-merge-containers-invalid-position' );
-		} );
 	} );
 } );

+ 0 - 18
packages/ckeditor5-engine/tests/view/writer/move.js

@@ -141,23 +141,5 @@ describe( 'writer', () => {
 				move( srcRange, dstPosition );
 			} ).to.throw( CKEditorError, 'view-writer-cannot-break-empty-element' );
 		} );
-
-		it( 'should move WidgetElements', () => {
-			test(
-				'<container:p>foo[<widget:foo></widget:foo>]bar</container:p>',
-				'<container:div>[]</container:div>',
-				'<container:p>foobar</container:p>',
-				'<container:div>[<widget:foo contenteditable="false"></widget:foo>]</container:div>'
-			);
-		} );
-
-		it( 'should move into WidgetElements', () => {
-			test(
-				'<container:p>[foo bar]</container:p>',
-				'<widget:fig>this is {} moved</widget:fig>',
-				'<container:p></container:p>',
-				'<widget:fig contenteditable="false">this is {foo bar} moved</widget:fig>'
-			);
-		} );
 	} );
 } );

+ 0 - 16
packages/ckeditor5-engine/tests/view/writer/remove.js

@@ -130,21 +130,5 @@ describe( 'writer', () => {
 				remove( range );
 			} ).to.throw( CKEditorError, 'view-writer-cannot-break-empty-element' );
 		} );
-
-		it( 'should remove WidgetElements', () => {
-			test(
-				'<container:p>[<widget:baz>foo bar</widget:baz>]</container:p>',
-				'<container:p>[]</container:p>',
-				'<widget:baz contenteditable="false">foo bar</widget:baz>'
-			);
-		} );
-
-		it( 'should remove inside WidgetElement', () => {
-			test(
-				'<widget:foo>foo {bar <attribute:b>baz</attribute:b>]bat</widget:foo>',
-				'<widget:foo contenteditable="false">foo {}bat</widget:foo>',
-				'bar <attribute:b view-priority="10">baz</attribute:b>'
-			);
-		} );
 	} );
 } );

+ 0 - 8
packages/ckeditor5-engine/tests/view/writer/unwrap.js

@@ -318,13 +318,5 @@ describe( 'writer', () => {
 				unwrap( range, attribute );
 			} ).to.throw( CKEditorError, 'view-writer-cannot-break-empty-element' );
 		} );
-
-		it( 'should unwrap inside widget element', () => {
-			test(
-				'<widget:foo>[<attribute:b>bar</attribute:b>]</widget:foo>',
-				'<attribute:b></attribute:b>',
-				'<widget:foo contenteditable="false">[bar]</widget:foo>'
-			);
-		} );
 	} );
 } );

+ 0 - 8
packages/ckeditor5-engine/tests/view/writer/wrap.js

@@ -289,13 +289,5 @@ describe( 'writer', () => {
 				wrap( range, new AttributeElement( 'b' ) );
 			} ).to.throw( CKEditorError, 'view-writer-cannot-break-empty-element' );
 		} );
-
-		it( 'should wrap inside WidgetElements', () => {
-			test(
-				'<widget:foo>[foo bar]</widget:foo>',
-				'<attribute:b></attribute:b>',
-				'<widget:foo contenteditable="false">[<attribute:b view-priority="10">foo bar</attribute:b>]</widget:foo>'
-			);
-		} );
 	} );
 } );