|
@@ -259,10 +259,6 @@ describe( 'Template', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'throws when wrong template definition', () => {
|
|
it( 'throws when wrong template definition', () => {
|
|
|
- expect( () => {
|
|
|
|
|
- new Template( {} ).apply( el );
|
|
|
|
|
- } ).to.throw( CKEditorError, /ui-template-wrong-syntax/ );
|
|
|
|
|
-
|
|
|
|
|
expect( () => {
|
|
expect( () => {
|
|
|
new Template( {
|
|
new Template( {
|
|
|
tag: 'p',
|
|
tag: 'p',
|
|
@@ -279,6 +275,14 @@ describe( 'Template', () => {
|
|
|
} ).to.throw( CKEditorError, /ui-template-wrong-node/ );
|
|
} ).to.throw( CKEditorError, /ui-template-wrong-node/ );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
|
|
+ it( 'accepts empty template definition', () => {
|
|
|
|
|
+ new Template( {} ).apply( el );
|
|
|
|
|
+ new Template( {} ).apply( text );
|
|
|
|
|
+
|
|
|
|
|
+ expect( el.outerHTML ).to.be.equal( '<div></div>' );
|
|
|
|
|
+ expect( text.textContent ).to.be.equal( '' );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
it( 'applies textContent to a Text Node', () => {
|
|
it( 'applies textContent to a Text Node', () => {
|
|
|
new Template( {
|
|
new Template( {
|
|
|
text: 'abc'
|
|
text: 'abc'
|