rootelement.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. /* bender-include: ../_tools/tools.js */
  7. 'use strict';
  8. const getIteratorCount = bender.tools.core.getIteratorCount;
  9. const modules = bender.amd.require(
  10. 'core/treemodel/document',
  11. 'core/treemodel/element',
  12. 'core/treemodel/rootelement'
  13. );
  14. describe( 'Element', () => {
  15. let Document, Element, RootElement;
  16. before( () => {
  17. Document = modules[ 'core/treemodel/document' ];
  18. Element = modules[ 'core/treemodel/element' ];
  19. RootElement = modules[ 'core/treemodel/rootelement' ];
  20. } );
  21. describe( 'constructor', () => {
  22. it( 'should create root element without attributes', () => {
  23. let doc = new Document();
  24. let root = new RootElement( doc );
  25. expect( root ).to.be.an.instanceof( Element );
  26. expect( root ).to.have.property( 'document' ).that.equals( doc );
  27. expect( getIteratorCount( root.getAttrs() ) ).to.equal( 0 );
  28. expect( root.getChildCount() ).to.equal( 0 );
  29. } );
  30. } );
  31. } );