|
|
@@ -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 );
|
|
|
} );
|
|
|
} );
|
|
|
} );
|