rootelement.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* jshint expr: true */
  6. /* bender-tags: document */
  7. /* bender-include: ../_tools/tools.js */
  8. 'use strict';
  9. const getIteratorCount = bender.tools.core.getIteratorCount;
  10. const modules = bender.amd.require(
  11. 'document/document',
  12. 'document/element',
  13. 'document/rootelement'
  14. );
  15. describe( 'Element', () => {
  16. let Document, Element, RootElement;
  17. before( () => {
  18. Document = modules[ 'document/document' ];
  19. Element = modules[ 'document/element' ];
  20. RootElement = modules[ 'document/rootelement' ];
  21. } );
  22. describe( 'constructor', () => {
  23. it( 'should create root element without attributes', () => {
  24. let doc = new Document();
  25. let root = new RootElement( doc );
  26. expect( root ).to.be.an.instanceof( Element );
  27. expect( root ).to.have.property( 'document' ).that.equals( doc );
  28. expect( getIteratorCount( root.getAttrs() ) ).to.equal( 0 );
  29. expect( root.getChildCount() ).to.equal( 0 );
  30. } );
  31. } );
  32. } );