Răsfoiți Sursa

Tests: Additional test to increase code coverage.

Aleksander Nowodzinski 9 ani în urmă
părinte
comite
7fa2f5941a

+ 1 - 1
packages/ckeditor5-ui/src/template.js

@@ -815,7 +815,7 @@ function arrayValueReducer( prev, cur ) {
 function extendObjectValueArray( obj, ext ) {
 	for ( let a in ext ) {
 		if ( obj[ a ] ) {
-			obj[ a ].push( ...ext[ a ] || [] );
+			obj[ a ].push( ...ext[ a ] );
 		} else {
 			obj[ a ] = ext[ a ];
 		}

+ 19 - 0
packages/ckeditor5-ui/tests/template.js

@@ -1540,6 +1540,25 @@ describe( 'Template', () => {
 				);
 			} );
 
+			it( 'appends new - no children', () => {
+				extensionTest(
+					{
+						tag: 'p'
+					},
+					{
+						children: [
+							{
+								tag: 'span',
+								attributes: {
+									class: 'bar'
+								}
+							}
+						]
+					},
+					'<p><span class="bar"></span></p>'
+				);
+			} );
+
 			it( 'appends new - element', () => {
 				extensionTest(
 					{