8
0
Pārlūkot izejas kodu

Removed old getIteratorCount name, changed to utils.count.

Szymon Kupś 9 gadi atpakaļ
vecāks
revīzija
37eca4ed98

+ 2 - 4
packages/ckeditor5-engine/tests/treemodel/delta/attributedelta.js

@@ -17,8 +17,6 @@ import Element from '/ckeditor5/core/treemodel/element.js';
 import AttributeDelta from '/ckeditor5/core/treemodel/delta/attributedelta.js';
 import AttributeOperation from '/ckeditor5/core/treemodel/operation/attributeoperation.js';
 
-const getIteratorCount = utils.count;
-
 let doc, root;
 
 beforeEach( () => {
@@ -37,7 +35,7 @@ describe( 'Batch', () => {
 		let count = 0;
 
 		for ( let delta of batch.deltas ) {
-			count += getIteratorCount( delta.operations );
+			count += utils.count( delta.operations );
 		}
 
 		return count;
@@ -143,7 +141,7 @@ describe( 'Batch', () => {
 
 			for ( let delta of batch.deltas ) {
 				for ( let operation of delta.operations ) {
-					count += getIteratorCount( operation.range.getItems( { singleCharacters: true } ) );
+					count += utils.count( operation.range.getItems( { singleCharacters: true } ) );
 				}
 			}
 

+ 1 - 3
packages/ckeditor5-engine/tests/treemodel/delta/delta.js

@@ -31,8 +31,6 @@ class BarOperation extends FooOperation {
 	}
 }
 
-const getIteratorCount = utils.count;
-
 describe( 'Delta', () => {
 	describe( 'constructor', () => {
 		it( 'should create an delta with empty properties', () => {
@@ -72,7 +70,7 @@ describe( 'Delta', () => {
 			delta.addOperation( {} );
 			delta.addOperation( {} );
 
-			const count = getIteratorCount( delta.operations );
+			const count = utils.count( delta.operations );
 
 			expect( count ).to.equal( 3 );
 		} );

+ 3 - 5
packages/ckeditor5-engine/tests/treeview/domconverter.js

@@ -12,8 +12,6 @@ import ViewElement from '/ckeditor5/core/treeview/element.js';
 import ViewText from '/ckeditor5/core/treeview/text.js';
 import DomConverter from '/ckeditor5/core/treeview/domconverter.js';
 
-const getIteratorCount = utils.count;
-
 describe( 'DomConverter', () => {
 	let converter;
 
@@ -79,7 +77,7 @@ describe( 'DomConverter', () => {
 			expect( viewP.name ).to.equal( 'p' );
 
 			expect( viewP.getAttribute( 'class' ) ).to.equal( 'foo' );
-			expect( getIteratorCount( viewP.getAttributeKeys() ) ).to.equal( 1 );
+			expect( utils.count( viewP.getAttributeKeys() ) ).to.equal( 1 );
 
 			expect( viewP.getChildCount() ).to.equal( 2 );
 			expect( viewP.getChild( 0 ).name ).to.equal( 'img' );
@@ -105,7 +103,7 @@ describe( 'DomConverter', () => {
 			expect( viewP.name ).to.equal( 'p' );
 
 			expect( viewP.getAttribute( 'class' ) ).to.equal( 'foo' );
-			expect( getIteratorCount( viewP.getAttributeKeys() ) ).to.equal( 1 );
+			expect( utils.count( viewP.getAttributeKeys() ) ).to.equal( 1 );
 
 			expect( viewP.getChildCount() ).to.equal( 2 );
 			expect( viewP.getChild( 0 ).name ).to.equal( 'img' );
@@ -135,7 +133,7 @@ describe( 'DomConverter', () => {
 			expect( viewP.name ).to.equal( 'p' );
 
 			expect( viewP.getAttribute( 'class' ) ).to.equal( 'foo' );
-			expect( getIteratorCount( viewP.getAttributeKeys() ) ).to.equal( 1 );
+			expect( utils.count( viewP.getAttributeKeys() ) ).to.equal( 1 );
 
 			expect( viewP.getChildCount() ).to.equal( 0 );
 			expect( converter.getCorrespondingDom( viewP ) ).to.not.equal( domP );

+ 4 - 6
packages/ckeditor5-engine/tests/treeview/element.js

@@ -11,8 +11,6 @@ import utils from '/ckeditor5/utils/utils.js';
 import Node from '/ckeditor5/core/treeview/node.js';
 import ViewElement from '/ckeditor5/core/treeview/element.js';
 
-const getIteratorCount = utils.count;
-
 describe( 'Element', () => {
 	describe( 'constructor', () => {
 		it( 'should create element without attributes', () => {
@@ -21,14 +19,14 @@ describe( 'Element', () => {
 			expect( el ).to.be.an.instanceof( Node );
 			expect( el ).to.have.property( 'name' ).that.equals( 'p' );
 			expect( el ).to.have.property( 'parent' ).that.is.null;
-			expect( getIteratorCount( el.getAttributeKeys() ) ).to.equal( 0 );
+			expect( utils.count( el.getAttributeKeys() ) ).to.equal( 0 );
 		} );
 
 		it( 'should create element with attributes as plain object', () => {
 			const el = new ViewElement( 'p', { foo: 'bar' } );
 
 			expect( el ).to.have.property( 'name' ).that.equals( 'p' );
-			expect( getIteratorCount( el.getAttributeKeys() ) ).to.equal( 1 );
+			expect( utils.count( el.getAttributeKeys() ) ).to.equal( 1 );
 			expect( el.getAttribute( 'foo' ) ).to.equal( 'bar' );
 		} );
 
@@ -39,7 +37,7 @@ describe( 'Element', () => {
 			const el = new ViewElement( 'p', attrs );
 
 			expect( el ).to.have.property( 'name' ).that.equals( 'p' );
-			expect( getIteratorCount( el.getAttributeKeys() ) ).to.equal( 1 );
+			expect( utils.count( el.getAttributeKeys() ) ).to.equal( 1 );
 			expect( el.getAttribute( 'foo' ) ).to.equal( 'bar' );
 		} );
 
@@ -282,7 +280,7 @@ describe( 'Element', () => {
 
 				expect( el.hasAttribute( 'foo' ) ).to.be.false;
 
-				expect( getIteratorCount( el.getAttributeKeys() ) ).to.equal( 0 );
+				expect( utils.count( el.getAttributeKeys() ) ).to.equal( 0 );
 			} );
 		} );
 	} );