Jelajahi Sumber

Tests: Minor corrections and improvements.

Piotrek Koszuliński 10 tahun lalu
induk
melakukan
8d490ecac9

+ 20 - 20
packages/ckeditor5-engine/tests/treeview/converter.js

@@ -41,7 +41,7 @@ describe( 'converter', () => {
 			expect( converter.compareNodes( domElement, viewText ) ).to.be.false;
 			expect( converter.compareNodes( domElement, viewText ) ).to.be.false;
 		} );
 		} );
 
 
-		it( 'should return true for binded elements', () => {
+		it( 'should return true for bound elements', () => {
 			const domElement = document.createElement( 'p' );
 			const domElement = document.createElement( 'p' );
 			const viewElement = new ViewElement( 'p' );
 			const viewElement = new ViewElement( 'p' );
 
 
@@ -160,13 +160,13 @@ describe( 'converter', () => {
 			const domP = converter.viewToDom( viewP, document );
 			const domP = converter.viewToDom( viewP, document );
 
 
 			expect( domP ).to.be.an.instanceof( HTMLElement );
 			expect( domP ).to.be.an.instanceof( HTMLElement );
-			expect( domP.tagName.toLowerCase() ).to.equal( 'p' );
+			expect( domP.tagName ).to.equal( 'P' );
 
 
 			expect( domP.getAttribute( 'class' ) ).to.equal( 'foo' );
 			expect( domP.getAttribute( 'class' ) ).to.equal( 'foo' );
 			expect( domP.attributes.length ).to.equal( 1 );
 			expect( domP.attributes.length ).to.equal( 1 );
 
 
 			expect( domP.childNodes.length ).to.equal( 2 );
 			expect( domP.childNodes.length ).to.equal( 2 );
-			expect( domP.childNodes[ 0 ].tagName.toLowerCase() ).to.equal( 'img' );
+			expect( domP.childNodes[ 0 ].tagName ).to.equal( 'IMG' );
 			expect( domP.childNodes[ 1 ].data ).to.equal( 'foo' );
 			expect( domP.childNodes[ 1 ].data ).to.equal( 'foo' );
 
 
 			expect( converter.getCorrespondingView( domP ) ).not.to.equal( viewP );
 			expect( converter.getCorrespondingView( domP ) ).not.to.equal( viewP );
@@ -186,13 +186,13 @@ describe( 'converter', () => {
 			const domP = converter.viewToDom( viewP, document, { bind: true } );
 			const domP = converter.viewToDom( viewP, document, { bind: true } );
 
 
 			expect( domP ).to.be.an.instanceof( HTMLElement );
 			expect( domP ).to.be.an.instanceof( HTMLElement );
-			expect( domP.tagName.toLowerCase() ).to.equal( 'p' );
+			expect( domP.tagName ).to.equal( 'P' );
 
 
 			expect( domP.getAttribute( 'class' ) ).to.equal( 'foo' );
 			expect( domP.getAttribute( 'class' ) ).to.equal( 'foo' );
 			expect( domP.attributes.length ).to.equal( 1 );
 			expect( domP.attributes.length ).to.equal( 1 );
 
 
 			expect( domP.childNodes.length ).to.equal( 2 );
 			expect( domP.childNodes.length ).to.equal( 2 );
-			expect( domP.childNodes[ 0 ].tagName.toLowerCase() ).to.equal( 'img' );
+			expect( domP.childNodes[ 0 ].tagName ).to.equal( 'IMG' );
 			expect( domP.childNodes[ 1 ].data ).to.equal( 'foo' );
 			expect( domP.childNodes[ 1 ].data ).to.equal( 'foo' );
 
 
 			expect( converter.getCorrespondingView( domP ) ).to.equal( viewP );
 			expect( converter.getCorrespondingView( domP ) ).to.equal( viewP );
@@ -216,7 +216,7 @@ describe( 'converter', () => {
 			const domP = converter.viewToDom( viewP, document, { withChildren: false } );
 			const domP = converter.viewToDom( viewP, document, { withChildren: false } );
 
 
 			expect( domP ).to.be.an.instanceof( HTMLElement );
 			expect( domP ).to.be.an.instanceof( HTMLElement );
-			expect( domP.tagName.toLowerCase() ).to.equal( 'p' );
+			expect( domP.tagName ).to.equal( 'P' );
 
 
 			expect( domP.getAttribute( 'class' ) ).to.equal( 'foo' );
 			expect( domP.getAttribute( 'class' ) ).to.equal( 'foo' );
 			expect( domP.attributes.length ).to.equal( 1 );
 			expect( domP.attributes.length ).to.equal( 1 );
@@ -227,7 +227,7 @@ describe( 'converter', () => {
 	} );
 	} );
 
 
 	describe( 'getCorrespondingView', () => {
 	describe( 'getCorrespondingView', () => {
-		it( 'should return coresponding view element if element is passed', () => {
+		it( 'should return corresponding view element if element is passed', () => {
 			const domElement = document.createElement( 'p' );
 			const domElement = document.createElement( 'p' );
 			const viewElement = new ViewElement( 'p' );
 			const viewElement = new ViewElement( 'p' );
 
 
@@ -236,7 +236,7 @@ describe( 'converter', () => {
 			expect( converter.getCorrespondingView( domElement ) ).to.equal( viewElement );
 			expect( converter.getCorrespondingView( domElement ) ).to.equal( viewElement );
 		} );
 		} );
 
 
-		it( 'should return coresponding view text if text is passed', () => {
+		it( 'should return corresponding view text if text is passed', () => {
 			const domText = document.createTextNode( 'foo' );
 			const domText = document.createTextNode( 'foo' );
 			const domP = document.createElement( 'p' );
 			const domP = document.createElement( 'p' );
 
 
@@ -252,7 +252,7 @@ describe( 'converter', () => {
 	} );
 	} );
 
 
 	describe( 'getCorrespondingViewElement', () => {
 	describe( 'getCorrespondingViewElement', () => {
-		it( 'should return coresponding view element', () => {
+		it( 'should return corresponding view element', () => {
 			const domElement = document.createElement( 'p' );
 			const domElement = document.createElement( 'p' );
 			const viewElement = new ViewElement( 'p' );
 			const viewElement = new ViewElement( 'p' );
 
 
@@ -263,7 +263,7 @@ describe( 'converter', () => {
 	} );
 	} );
 
 
 	describe( 'getCorrespondingViewText', () => {
 	describe( 'getCorrespondingViewText', () => {
-		it( 'should return coresponding view text based on sibling', () => {
+		it( 'should return corresponding view text based on sibling', () => {
 			const domImg = document.createElement( 'img' );
 			const domImg = document.createElement( 'img' );
 			const domText = document.createTextNode( 'foo' );
 			const domText = document.createTextNode( 'foo' );
 			const domP = document.createElement( 'p' );
 			const domP = document.createElement( 'p' );
@@ -281,7 +281,7 @@ describe( 'converter', () => {
 			expect( converter.getCorrespondingViewText( domText ) ).to.equal( viewText );
 			expect( converter.getCorrespondingViewText( domText ) ).to.equal( viewText );
 		} );
 		} );
 
 
-		it( 'should return coresponding view text based on parent', () => {
+		it( 'should return corresponding view text based on parent', () => {
 			const domText = document.createTextNode( 'foo' );
 			const domText = document.createTextNode( 'foo' );
 			const domP = document.createElement( 'p' );
 			const domP = document.createElement( 'p' );
 
 
@@ -295,7 +295,7 @@ describe( 'converter', () => {
 			expect( converter.getCorrespondingViewText( domText ) ).to.equal( viewText );
 			expect( converter.getCorrespondingViewText( domText ) ).to.equal( viewText );
 		} );
 		} );
 
 
-		it( 'should return null if sibling is not binded', () => {
+		it( 'should return null if sibling is not bound', () => {
 			const domImg = document.createElement( 'img' );
 			const domImg = document.createElement( 'img' );
 			const domText = document.createTextNode( 'foo' );
 			const domText = document.createTextNode( 'foo' );
 			const domP = document.createElement( 'p' );
 			const domP = document.createElement( 'p' );
@@ -325,7 +325,7 @@ describe( 'converter', () => {
 			expect( converter.getCorrespondingViewText( domTextBar ) ).to.be.null;
 			expect( converter.getCorrespondingViewText( domTextBar ) ).to.be.null;
 		} );
 		} );
 
 
-		it( 'should return null if parent is not binded', () => {
+		it( 'should return null if parent is not bound', () => {
 			const domText = document.createTextNode( 'foo' );
 			const domText = document.createTextNode( 'foo' );
 			const domP = document.createElement( 'p' );
 			const domP = document.createElement( 'p' );
 
 
@@ -336,7 +336,7 @@ describe( 'converter', () => {
 	} );
 	} );
 
 
 	describe( 'getCorrespondingDom', () => {
 	describe( 'getCorrespondingDom', () => {
-		it( 'should return coresponding DOM element if element was passed', () => {
+		it( 'should return corresponding DOM element if element was passed', () => {
 			const domElement = document.createElement( 'p' );
 			const domElement = document.createElement( 'p' );
 			const viewElement = new ViewElement( 'p' );
 			const viewElement = new ViewElement( 'p' );
 
 
@@ -345,7 +345,7 @@ describe( 'converter', () => {
 			expect( converter.getCorrespondingDom( viewElement ) ).to.equal( domElement );
 			expect( converter.getCorrespondingDom( viewElement ) ).to.equal( domElement );
 		} );
 		} );
 
 
-		it( 'should return coresponding DOM text if text was passed', () => {
+		it( 'should return corresponding DOM text if text was passed', () => {
 			const domText = document.createTextNode( 'foo' );
 			const domText = document.createTextNode( 'foo' );
 			const domP = document.createElement( 'p' );
 			const domP = document.createElement( 'p' );
 
 
@@ -361,7 +361,7 @@ describe( 'converter', () => {
 	} );
 	} );
 
 
 	describe( 'getCorrespondingDomElement', () => {
 	describe( 'getCorrespondingDomElement', () => {
-		it( 'should return coresponding DOM element', () => {
+		it( 'should return corresponding DOM element', () => {
 			const domElement = document.createElement( 'p' );
 			const domElement = document.createElement( 'p' );
 			const viewElement = new ViewElement( 'p' );
 			const viewElement = new ViewElement( 'p' );
 
 
@@ -372,7 +372,7 @@ describe( 'converter', () => {
 	} );
 	} );
 
 
 	describe( 'getCorrespondingDomText', () => {
 	describe( 'getCorrespondingDomText', () => {
-		it( 'should return coresponding DOM text based on sibling', () => {
+		it( 'should return corresponding DOM text based on sibling', () => {
 			const domImg = document.createElement( 'img' );
 			const domImg = document.createElement( 'img' );
 			const domText = document.createTextNode( 'foo' );
 			const domText = document.createTextNode( 'foo' );
 			const domP = document.createElement( 'p' );
 			const domP = document.createElement( 'p' );
@@ -390,7 +390,7 @@ describe( 'converter', () => {
 			expect( converter.getCorrespondingDomText( viewText ) ).to.equal( domText );
 			expect( converter.getCorrespondingDomText( viewText ) ).to.equal( domText );
 		} );
 		} );
 
 
-		it( 'should return coresponding DOM text based on parent', () => {
+		it( 'should return corresponding DOM text based on parent', () => {
 			const domText = document.createTextNode( 'foo' );
 			const domText = document.createTextNode( 'foo' );
 			const domP = document.createElement( 'p' );
 			const domP = document.createElement( 'p' );
 
 
@@ -404,7 +404,7 @@ describe( 'converter', () => {
 			expect( converter.getCorrespondingDomText( viewText ) ).to.equal( domText );
 			expect( converter.getCorrespondingDomText( viewText ) ).to.equal( domText );
 		} );
 		} );
 
 
-		it( 'should return null if sibling is not binded', () => {
+		it( 'should return null if sibling is not bound', () => {
 			const domImg = document.createElement( 'img' );
 			const domImg = document.createElement( 'img' );
 			const domText = document.createTextNode( 'foo' );
 			const domText = document.createTextNode( 'foo' );
 			const domP = document.createElement( 'p' );
 			const domP = document.createElement( 'p' );
@@ -420,7 +420,7 @@ describe( 'converter', () => {
 			expect( converter.getCorrespondingDomText( viewText ) ).to.be.null;
 			expect( converter.getCorrespondingDomText( viewText ) ).to.be.null;
 		} );
 		} );
 
 
-		it( 'should return null if parent is not binded', () => {
+		it( 'should return null if parent is not bound', () => {
 			const domText = document.createTextNode( 'foo' );
 			const domText = document.createTextNode( 'foo' );
 			const domP = document.createElement( 'p' );
 			const domP = document.createElement( 'p' );
 
 

+ 2 - 2
packages/ckeditor5-engine/tests/treeview/element.js

@@ -25,7 +25,7 @@ describe( 'Element', () => {
 		} );
 		} );
 
 
 		it( 'should create element with attributes as plain object', () => {
 		it( 'should create element with attributes as plain object', () => {
-			const el = new ViewElement( 'p', { 'foo': 'bar' } );
+			const el = new ViewElement( 'p', { foo: 'bar' } );
 
 
 			expect( el ).to.have.property( 'name' ).that.equals( 'p' );
 			expect( el ).to.have.property( 'name' ).that.equals( 'p' );
 			expect( getIteratorCount( el.getAttributeKeys() ) ).to.equal( 1 );
 			expect( getIteratorCount( el.getAttributeKeys() ) ).to.equal( 1 );
@@ -44,7 +44,7 @@ describe( 'Element', () => {
 		} );
 		} );
 
 
 		it( 'should create element with children', () => {
 		it( 'should create element with children', () => {
-			const child = new ViewElement( 'p', { 'foo': 'bar' } );
+			const child = new ViewElement( 'p', { foo: 'bar' } );
 			const parent = new ViewElement( 'div', [], [ child ] );
 			const parent = new ViewElement( 'div', [], [ child ] );
 
 
 			expect( parent ).to.have.property( 'name' ).that.equals( 'div' );
 			expect( parent ).to.have.property( 'name' ).that.equals( 'div' );

+ 1 - 1
packages/ckeditor5-engine/tests/treeview/intergation.js → packages/ckeditor5-engine/tests/treeview/integration.js

@@ -32,6 +32,6 @@ describe( 'TreeView integration', () => {
 		treeView.render();
 		treeView.render();
 
 
 		expect( domDiv.childNodes.length ).to.equal( 1 );
 		expect( domDiv.childNodes.length ).to.equal( 1 );
-		expect( domDiv.childNodes[ 0 ].tagName.toLowerCase() ).to.equal( 'p' );
+		expect( domDiv.childNodes[ 0 ].tagName ).to.equal( 'P' );
 	} );
 	} );
 } );
 } );

+ 3 - 3
packages/ckeditor5-engine/tests/treeview/manual/init.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md.
  * For licensing, see LICENSE.md.
  */
  */
 
 
- /* global console:false */
+/* global console:false */
 
 
 'use strict';
 'use strict';
 
 
@@ -16,8 +16,8 @@ const treeView = new TreeView( document.getElementById( 'editor' ) );
 treeView.viewRoot.insertChildren( 0, [
 treeView.viewRoot.insertChildren( 0, [
 	new Element( 'p', [], [ new Text( 'New' ) ] ),
 	new Element( 'p', [], [ new Text( 'New' ) ] ),
 	new Element( 'p', [], [ new Text( 'Content' ) ] )
 	new Element( 'p', [], [ new Text( 'Content' ) ] )
-	] );
+] );
 
 
 treeView.render();
 treeView.render();
 
 
-console.log( treeView );
+console.log( treeView );

+ 3 - 3
packages/ckeditor5-engine/tests/treeview/manual/mutationobserver.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md.
  * For licensing, see LICENSE.md.
  */
  */
 
 
- /* global console:false */
+/* global console:false */
 
 
 'use strict';
 'use strict';
 
 
@@ -22,6 +22,6 @@ treeView.addObserver( mutationObserver );
 treeView.viewRoot.insertChildren( 0, [
 treeView.viewRoot.insertChildren( 0, [
 	new Element( 'p', [], [ new Text( 'foo' ) ] ),
 	new Element( 'p', [], [ new Text( 'foo' ) ] ),
 	new Element( 'p', [], [ new Text( 'bom' ) ] )
 	new Element( 'p', [], [ new Text( 'bom' ) ] )
-	] );
+] );
 
 
-treeView.render();
+treeView.render();

+ 7 - 14
packages/ckeditor5-engine/tests/treeview/manual/mutationobserver.md

@@ -2,21 +2,14 @@
 @bender-tags: treeview
 @bender-tags: treeview
 
 
 Try to:
 Try to:
- - type,
- - break paragraph,
- - delete break,
- - bold,
- - move text/paragraph,
- - insert/delete paragraph.
+
+* type,
+* break paragraph,
+* delete break,
+* bold,
+* move text/paragraph,
+* insert/delete paragraph.
 
 
 ## Mutation Preventing ##
 ## Mutation Preventing ##
 
 
 Document should not change, all changes should be prevented before rendering. Selection may change.
 Document should not change, all changes should be prevented before rendering. Selection may change.
-
-## Mutation Observer ##
-
-Check the console for the mutation events. There should be:
- - no duplications,
- - only TreeView objects,
- - only mutation on TreeView children,
- - text mutation only if parents child list do not change.

+ 2 - 2
packages/ckeditor5-engine/tests/treeview/manual/typing.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md.
  * For licensing, see LICENSE.md.
  */
  */
 
 
- /* global console:false */
+/* global console:false */
 
 
 'use strict';
 'use strict';
 
 
@@ -31,4 +31,4 @@ function handleTyping( evt, mutations ) {
 	}
 	}
 
 
 	mutation.node.setText( mutation.newText );
 	mutation.node.setText( mutation.newText );
-}
+}

+ 3 - 3
packages/ckeditor5-engine/tests/treeview/manual/typing.md

@@ -3,6 +3,6 @@
 
 
 ## Typing ##
 ## Typing ##
 
 
- - It should be possible to type (change the content of the text node).
- - All other operations should be permitted, it should not be possible to remove whole node.
- - Composition should work fine, not be broken.
+* It should be possible to type (change the content of the text node).
+* All other operations should be permitted, it should not be possible to remove whole node.
+* Composition should work fine, not be broken.

+ 1 - 1
packages/ckeditor5-engine/tests/treeview/node.js

@@ -73,7 +73,7 @@ describe( 'Node', () => {
 			expect( charR.getIndex() ).to.equal( 3 );
 			expect( charR.getIndex() ).to.equal( 3 );
 		} );
 		} );
 
 
-		it( 'should throw an error if parent does not contains element', () => {
+		it( 'should throw an error if parent does not contain element', () => {
 			let f = new Text( 'f' );
 			let f = new Text( 'f' );
 			let bar = new Element( 'bar', [], [] );
 			let bar = new Element( 'bar', [], [] );
 
 

+ 28 - 28
packages/ckeditor5-engine/tests/treeview/observer/mutationobserver.js

@@ -42,11 +42,11 @@ describe( 'MutationObserver', () => {
 		handleMutation();
 		handleMutation();
 
 
 		expectDomEditorNotToChange();
 		expectDomEditorNotToChange();
-		expect( lastMutations.length ).to.equals( 1 );
-		expect( lastMutations[ 0 ].type ).to.equals( 'text' );
-		expect( lastMutations[ 0 ].node ).to.equals( treeView.viewRoot.getChild( 0 ).getChild( 0 ) );
-		expect( lastMutations[ 0 ].newText ).to.equals( 'foom' );
-		expect( lastMutations[ 0 ].oldText ).to.equals( 'foo' );
+		expect( lastMutations.length ).to.equal( 1 );
+		expect( lastMutations[ 0 ].type ).to.equal( 'text' );
+		expect( lastMutations[ 0 ].node ).to.equal( treeView.viewRoot.getChild( 0 ).getChild( 0 ) );
+		expect( lastMutations[ 0 ].newText ).to.equal( 'foom' );
+		expect( lastMutations[ 0 ].oldText ).to.equal( 'foo' );
 	} );
 	} );
 
 
 	it( 'should handle bold', () => {
 	it( 'should handle bold', () => {
@@ -58,16 +58,16 @@ describe( 'MutationObserver', () => {
 		handleMutation();
 		handleMutation();
 
 
 		expectDomEditorNotToChange();
 		expectDomEditorNotToChange();
-		expect( lastMutations.length ).to.equals( 1 );
-		expect( lastMutations[ 0 ].type ).to.equals( 'children' );
-		expect( lastMutations[ 0 ].node ).to.equals( treeView.viewRoot.getChild( 0 ) );
+		expect( lastMutations.length ).to.equal( 1 );
+		expect( lastMutations[ 0 ].type ).to.equal( 'children' );
+		expect( lastMutations[ 0 ].node ).to.equal( treeView.viewRoot.getChild( 0 ) );
 
 
-		expect( lastMutations[ 0 ].newChildren.length ).to.equals( 2 );
-		expect( lastMutations[ 0 ].newChildren[ 0 ].getText() ).to.equals( 'f' );
-		expect( lastMutations[ 0 ].newChildren[ 1 ].name ).to.equals( 'b' );
+		expect( lastMutations[ 0 ].newChildren.length ).to.equal( 2 );
+		expect( lastMutations[ 0 ].newChildren[ 0 ].getText() ).to.equal( 'f' );
+		expect( lastMutations[ 0 ].newChildren[ 1 ].name ).to.equal( 'b' );
 
 
-		expect( lastMutations[ 0 ].oldChildren.length ).to.equals( 1 );
-		expect( lastMutations[ 0 ].oldChildren[ 0 ].getText() ).to.equals( 'foo' );
+		expect( lastMutations[ 0 ].oldChildren.length ).to.equal( 1 );
+		expect( lastMutations[ 0 ].oldChildren[ 0 ].getText() ).to.equal( 'foo' );
 	} );
 	} );
 
 
 	it( 'should deduplicate text changes', () => {
 	it( 'should deduplicate text changes', () => {
@@ -77,11 +77,11 @@ describe( 'MutationObserver', () => {
 		handleMutation();
 		handleMutation();
 
 
 		expectDomEditorNotToChange();
 		expectDomEditorNotToChange();
-		expect( lastMutations.length ).to.equals( 1 );
-		expect( lastMutations[ 0 ].type ).to.equals( 'text' );
-		expect( lastMutations[ 0 ].node ).to.equals( treeView.viewRoot.getChild( 0 ).getChild( 0 ) );
-		expect( lastMutations[ 0 ].newText ).to.equals( 'fooxy' );
-		expect( lastMutations[ 0 ].oldText ).to.equals( 'foo' );
+		expect( lastMutations.length ).to.equal( 1 );
+		expect( lastMutations[ 0 ].type ).to.equal( 'text' );
+		expect( lastMutations[ 0 ].node ).to.equal( treeView.viewRoot.getChild( 0 ).getChild( 0 ) );
+		expect( lastMutations[ 0 ].newText ).to.equal( 'fooxy' );
+		expect( lastMutations[ 0 ].oldText ).to.equal( 'foo' );
 	} );
 	} );
 
 
 	it( 'should ignore changes in elements not attached to tree view', () => {
 	it( 'should ignore changes in elements not attached to tree view', () => {
@@ -96,9 +96,9 @@ describe( 'MutationObserver', () => {
 		handleMutation();
 		handleMutation();
 
 
 		expectDomEditorNotToChange();
 		expectDomEditorNotToChange();
-		expect( lastMutations.length ).to.equals( 1 );
-		expect( lastMutations[ 0 ].type ).to.equals( 'children' );
-		expect( lastMutations[ 0 ].node ).to.equals( treeView.viewRoot );
+		expect( lastMutations.length ).to.equal( 1 );
+		expect( lastMutations[ 0 ].type ).to.equal( 'children' );
+		expect( lastMutations[ 0 ].node ).to.equal( treeView.viewRoot );
 	} );
 	} );
 
 
 	function handleMutation() {
 	function handleMutation() {
@@ -106,14 +106,14 @@ describe( 'MutationObserver', () => {
 	}
 	}
 
 
 	function expectDomEditorNotToChange() {
 	function expectDomEditorNotToChange() {
-		expect( domEditor.childNodes.length ).to.equals( 2 );
-		expect( domEditor.childNodes[ 0 ].tagName.toLowerCase() ).to.equals( 'p' );
-		expect( domEditor.childNodes[ 1 ].tagName.toLowerCase() ).to.equals( 'p' );
+		expect( domEditor.childNodes.length ).to.equal( 2 );
+		expect( domEditor.childNodes[ 0 ].tagName ).to.equal( 'P' );
+		expect( domEditor.childNodes[ 1 ].tagName ).to.equal( 'P' );
 
 
-		expect( domEditor.childNodes[ 0 ].childNodes.length ).to.equals( 1 );
-		expect( domEditor.childNodes[ 0 ].childNodes[ 0 ].data ).to.equals( 'foo' );
+		expect( domEditor.childNodes[ 0 ].childNodes.length ).to.equal( 1 );
+		expect( domEditor.childNodes[ 0 ].childNodes[ 0 ].data ).to.equal( 'foo' );
 
 
-		expect( domEditor.childNodes[ 1 ].childNodes.length ).to.equals( 1 );
-		expect( domEditor.childNodes[ 1 ].childNodes[ 0 ].data ).to.equals( 'bar' );
+		expect( domEditor.childNodes[ 1 ].childNodes.length ).to.equal( 1 );
+		expect( domEditor.childNodes[ 1 ].childNodes[ 0 ].data ).to.equal( 'bar' );
 	}
 	}
 } );
 } );

+ 3 - 3
packages/ckeditor5-engine/tests/treeview/renderer.js

@@ -194,7 +194,7 @@ describe( 'Renderer', () => {
 			renderer.render();
 			renderer.render();
 
 
 			expect( domNode.childNodes.length ).to.equal( 2 );
 			expect( domNode.childNodes.length ).to.equal( 2 );
-			expect( domNode.childNodes[ 0 ].tagName.toLowerCase() ).to.equal( 'img' );
+			expect( domNode.childNodes[ 0 ].tagName ).to.equal( 'IMG' );
 			expect( domNode.childNodes[ 1 ].data ).to.equal( 'foo' );
 			expect( domNode.childNodes[ 1 ].data ).to.equal( 'foo' );
 		} );
 		} );
 
 
@@ -264,7 +264,7 @@ describe( 'Renderer', () => {
 			renderer.render();
 			renderer.render();
 
 
 			expect( domNode.childNodes.length ).to.equal( 1 );
 			expect( domNode.childNodes.length ).to.equal( 1 );
-			expect( domNode.childNodes[ 0 ].tagName.toLowerCase() ).to.equal( 'p' );
+			expect( domNode.childNodes[ 0 ].tagName ).to.equal( 'P' );
 		} );
 		} );
 	} );
 	} );
-} );
+} );