8
0

text.js 796 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. const modules = bender.amd.require(
  8. 'core/treemodel/text',
  9. 'core/treemodel/attribute'
  10. );
  11. describe( 'Text', () => {
  12. describe( 'constructor', () => {
  13. it( 'should create character without attributes', () => {
  14. const Text = modules[ 'core/treemodel/text' ];
  15. const Attribute = modules[ 'core/treemodel/attribute' ];
  16. let attrs = [ new Attribute( 'bold', true ) ];
  17. let text = new Text( 'bar', attrs );
  18. expect( text ).to.have.property( 'text' ).that.equals( 'bar' );
  19. expect( text ).to.have.property( 'attrs' ).that.is.an( 'array' );
  20. expect( text.attrs ).to.be.deep.equals( attrs );
  21. } );
  22. } );
  23. } );