瀏覽代碼

Tests: Small refactor to improve readablity.

Szymon Cofalik 7 年之前
父節點
當前提交
d4d72cac2a
共有 1 個文件被更改,包括 29 次插入12 次删除
  1. 29 12
      packages/ckeditor5-engine/tests/view/renderer.js

+ 29 - 12
packages/ckeditor5-engine/tests/view/renderer.js

@@ -1571,11 +1571,17 @@ describe( 'Renderer', () => {
 			renderer.markToSync( 'text', viewHeading.getChild( 0 ) );
 
 			// '<p>Ph <strong>Bold</strong> <i>It<strong>alic</strong></i> <a><strong>Lin</strong>k</a></p>'
-			// -> '<p>Ph <i><strong>Italic</strong></i> <a><strong>L</strong>ink 1</a></p>'
+			// ->
+			// '<p>Ph <i><strong>Italic</strong></i> <a><strong>L</strong>ink 1</a></p>'
 			const viewP = viewRoot.getChild( 1 );
 			viewP._removeChildren( 0, viewP.childCount );
-			viewP._insertChildren( 0, parse( 'Ph <attribute:i><attribute:strong>Italic</attribute:strong></attribute:i> ' +
-				'<attribute:a href="https://ckeditor.com"><attribute:strong>L</attribute:strong>ink 1</attribute:a>' ) );
+			viewP._insertChildren(
+				0,
+				parse(
+					'Ph <attribute:i><attribute:strong>Italic</attribute:strong></attribute:i> ' +
+					'<attribute:a href="https://ckeditor.com"><attribute:strong>L</attribute:strong>ink 1</attribute:a>'
+				)
+			);
 
 			renderer.markToSync( 'children', viewRoot );
 			renderer.markToSync( 'children', viewP );
@@ -1588,8 +1594,13 @@ describe( 'Renderer', () => {
 			// -> '<blockquote><p>Qu<strong>ote</strong></p><ul><li><strong>Quoted item 1</strong></li></ul></blockquote>'
 			const viewBq = viewRoot.getChild( 2 );
 			viewBq._removeChildren( 0, viewBq.childCount );
-			viewBq._insertChildren( 0, parse( '<container:p>Qu<attribute:strong>ote</attribute:strong></container:p>' +
-				'<container:ul><container:li><attribute:strong>Quoted item 1</attribute:strong></container:li></container:ul>' ) );
+			viewBq._insertChildren(
+				0,
+				parse(
+					'<container:p>Qu<attribute:strong>ote</attribute:strong></container:p>' +
+					'<container:ul><container:li><attribute:strong>Quoted item 1</attribute:strong></container:li></container:ul>'
+				)
+			);
 
 			renderer.markToSync( 'children', viewRoot );
 			renderer.markToSync( 'children', viewBq );
@@ -1598,9 +1609,11 @@ describe( 'Renderer', () => {
 
 			renderer.render();
 
-			expect( normalizeHtml( domRoot.innerHTML ) ).to.equal( '<h2>Heading 2</h2>' +
+			expect( normalizeHtml( domRoot.innerHTML ) ).to.equal(
+				'<h2>Heading 2</h2>' +
 				'<p>Ph <i><strong>Italic</strong></i> <a href="https://ckeditor.com"><strong>L</strong>ink 1</a></p>' +
-				'<blockquote><p>Qu<strong>ote</strong></p><ul><li><strong>Quoted item 1</strong></li></ul></blockquote>' );
+				'<blockquote><p>Qu<strong>ote</strong></p><ul><li><strong>Quoted item 1</strong></li></ul></blockquote>'
+			);
 		} );
 
 		// #1125
@@ -1616,23 +1629,25 @@ describe( 'Renderer', () => {
 			//		<p>Not Quoted <strong>item 1</strong> and item 2</p>
 			//
 			// during one rerender to check if complex structure changes are rerendered correctly.
-			const viewContent = parse( '' +
+			const viewContent = parse(
 				'<container:h1>Header</container:h1>' +
 				'<container:blockquote>' +
 					'<container:ul>' +
 						'<container:li>Quoted <attribute:strong>item 1</attribute:strong></container:li>' +
 						'<container:li>Item 2</container:li>' +
 					'</container:ul>' +
-				'</container:blockquote>' );
+				'</container:blockquote>'
+			);
 
 			viewRoot._appendChildren( viewContent );
 
 			renderer.markToSync( 'children', viewRoot );
 			renderer.render();
 
-			const newViewContent = parse( '' +
+			const newViewContent = parse(
 				'<container:h2>Header</container:h2>' +
-				'<container:p>Not Quoted <attribute:strong>item 1</attribute:strong> and item 2</container:p>' );
+				'<container:p>Not Quoted <attribute:strong>item 1</attribute:strong> and item 2</container:p>'
+			);
 
 			viewRoot._removeChildren( 0, viewRoot.childCount );
 			viewRoot._appendChildren( newViewContent );
@@ -1640,7 +1655,9 @@ describe( 'Renderer', () => {
 			renderer.markToSync( 'children', viewRoot );
 			renderer.render();
 
-			expect( normalizeHtml( domRoot.innerHTML ) ).to.equal( '<h2>Header</h2><p>Not Quoted <strong>item 1</strong> and item 2</p>' );
+			expect( normalizeHtml( domRoot.innerHTML ) ).to.equal(
+				'<h2>Header</h2><p>Not Quoted <strong>item 1</strong> and item 2</p>'
+			);
 		} );
 
 		describe( 'fake selection', () => {