Browse Source

Changes variables names in tests.

Oskar Wrobel 9 years ago
parent
commit
36ad7deb24

+ 5 - 5
packages/ckeditor5-engine/tests/view/textproxy.js

@@ -14,16 +14,16 @@ import ContainerElement from '/ckeditor5/engine/view/containerelement.js';
 describe( 'TextProxy', () => {
 	describe( 'constructor', () => {
 		it( 'should create TextProxy instance with specified properties', () => {
-			const text = new Text( 'abcdefgh' );
-			const paragraph = new ContainerElement( 'p', [], [ text ] );
+			const textElement = new Text( 'abcdefgh' );
+			const textParent = new ContainerElement( 'p', [], [ textElement ] );
 			const textFragment = 'cdef';
 			const index = 2;
 
-			const textProxy = new TextProxy( textFragment, paragraph, text, index );
+			const textProxy = new TextProxy( textFragment, textParent, textElement, index );
 
-			expect( textProxy ).to.have.property( 'parent' ).to.equal( paragraph );
+			expect( textProxy ).to.have.property( 'parent' ).to.equal( textParent );
 			expect( textProxy ).to.have.property( '_data' ).to.equal( textFragment );
-			expect( textProxy ).to.have.property( '_textNodeParent' ).to.equal( text );
+			expect( textProxy ).to.have.property( '_textNodeParent' ).to.equal( textElement );
 			expect( textProxy ).to.have.property( '_index' ).to.equal( index );
 		} );
 	} );

+ 9 - 9
packages/ckeditor5-engine/tests/view/treewalker.js

@@ -17,7 +17,7 @@ import Range from '/ckeditor5/engine/view/range.js';
 import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 describe( 'TreeWalker', () => {
-	let doc, root, img1, paragraph, bold, ba, r, img2, x;
+	let doc, root, img1, paragraph, bold, textBa, charR, img2, charX;
 	let rootBeginning, rootEnding;
 
 	before( () => {
@@ -37,13 +37,13 @@ describe( 'TreeWalker', () => {
 		//     |
 		//     |- X
 
-		ba = new Text( 'ba' );
-		bold = new Element( 'b', [], [ ba ] );
-		r = new Text( 'r' );
+		textBa = new Text( 'ba' );
+		bold = new Element( 'b', [], [ textBa ] );
+		charR = new Text( 'r' );
 		img2 = new Element( 'img2' );
-		x = new Text( 'x' );
+		charX = new Text( 'x' );
 
-		paragraph = new ContainerElement( 'p', [], [ bold, r, img2, x ] );
+		paragraph = new ContainerElement( 'p', [], [ bold, charR, img2, charX ] );
 		img1 = new Element( 'img1' );
 
 		root.insertChildren( 0, [ img1, paragraph ] );
@@ -211,7 +211,7 @@ describe( 'TreeWalker', () => {
 					{ type: 'ELEMENT_END', item: img2 }
 				];
 
-				range = Range.createFromParentsAndOffsets( ba, 1, paragraph, 3 );
+				range = Range.createFromParentsAndOffsets( textBa, 1, paragraph, 3 );
 			} );
 
 			it( 'should return part of the text', () => {
@@ -254,7 +254,7 @@ describe( 'TreeWalker', () => {
 					{ type: 'TEXT', text: 'b' }
 				];
 
-				range = new Range( rootBeginning, new Position( ba, 1 ) );
+				range = new Range( rootBeginning, new Position( textBa, 1 ) );
 			} );
 
 			it( 'should return part of the text', () => {
@@ -317,7 +317,7 @@ describe( 'TreeWalker', () => {
 					{ type: 'TEXT', text: 'a' }
 				];
 
-				let range = new Range( new Position( ba, 1 ), new Position( paragraph, 3 ) );
+				let range = new Range( new Position( textBa, 1 ), new Position( paragraph, 3 ) );
 
 				let iterator = new TreeWalker( {
 					boundaries: range,