rootelement.js 926 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* bender-tags: treemodel */
  6. 'use strict';
  7. import coreTestUtils from '/tests/core/_utils/utils.js';
  8. import Document from '/ckeditor5/core/treemodel/document.js';
  9. import Element from '/ckeditor5/core/treemodel/element.js';
  10. import RootElement from '/ckeditor5/core/treemodel/rootelement.js';
  11. const getIteratorCount = coreTestUtils.getIteratorCount;
  12. describe( 'Element', () => {
  13. describe( 'constructor', () => {
  14. it( 'should create root element without attributes', () => {
  15. let doc = new Document();
  16. let root = new RootElement( doc );
  17. expect( root ).to.be.an.instanceof( Element );
  18. expect( root ).to.have.property( 'document' ).that.equals( doc );
  19. expect( getIteratorCount( root.getAttrs() ) ).to.equal( 0 );
  20. expect( root.getChildCount() ).to.equal( 0 );
  21. } );
  22. } );
  23. } );