8
0
Kamil Piechaczek 8 лет назад
Родитель
Сommit
872e51bb93
1 измененных файлов с 18 добавлено и 18 удалено
  1. 18 18
      packages/ckeditor5-ui/tests/template.js

+ 18 - 18
packages/ckeditor5-ui/tests/template.js

@@ -9,7 +9,6 @@ import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
 import { default as Template, TemplateToBinding, TemplateIfBinding } from '../src/template';
 import { default as Template, TemplateToBinding, TemplateIfBinding } from '../src/template';
 import View from '../src/view';
 import View from '../src/view';
 import ViewCollection from '../src/viewcollection';
 import ViewCollection from '../src/viewcollection';
-import InputTextView from '../src/inputtext/inputtextview';
 import Model from '../src/model';
 import Model from '../src/model';
 import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 import EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';
 import EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';
@@ -122,23 +121,6 @@ describe( 'Template', () => {
 			expect( tpl.attributes.a[ 0 ] ).to.equal( 'foo' );
 			expect( tpl.attributes.a[ 0 ] ).to.equal( 'foo' );
 			expect( tpl.children.get( 0 ).tag ).to.equal( 'span' );
 			expect( tpl.children.get( 0 ).tag ).to.equal( 'span' );
 		} );
 		} );
-
-		it( 'does not throw when child does not have an "id" property', () => {
-			class DivView extends View {
-				constructor( locale ) {
-					super( locale );
-
-					this.template = new Template( {
-						tag: 'div',
-						children: [
-							new InputTextView( locale )
-						]
-					} );
-				}
-			}
-
-			expect( () => new DivView( {} ) ).to.not.throw( CKEditorError );
-		} );
 	} );
 	} );
 
 
 	describe( 'render()', () => {
 	describe( 'render()', () => {
@@ -588,6 +570,24 @@ describe( 'Template', () => {
 					'<p><a></a><b></b><i>foo</i></p>'
 					'<p><a></a><b></b><i>foo</i></p>'
 				);
 				);
 			} );
 			} );
+
+			// #289
+			it( 'does not throw when child does not have an "id" property', () => {
+				expect( () => {
+					const strongView = getView( {
+						tag: 'strong'
+					} );
+
+					strongView.set( 'id' );
+
+					getView( {
+						tag: 'div',
+						children: [
+							strongView
+						]
+					} );
+				} ).to.not.throw();
+			} );
 		} );
 		} );
 
 
 		describe( 'bindings', () => {
 		describe( 'bindings', () => {