text.js 808 B

12345678910111213141516171819202122232425
  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 Text from '/ckeditor5/core/treemodel/text.js';
  8. import Attribute from '/ckeditor5/core/treemodel/attribute.js';
  9. import AttributeList from '/ckeditor5/core/treemodel/attributelist.js';
  10. describe( 'Text', () => {
  11. describe( 'constructor', () => {
  12. it( 'should create character without attributes', () => {
  13. let attrs = [ new Attribute( 'bold', true ) ];
  14. let text = new Text( 'bar', attrs );
  15. expect( text ).to.have.property( 'text' ).that.equals( 'bar' );
  16. expect( text ).to.have.property( 'attrs' ).that.is.instanceof( AttributeList );
  17. expect( Array.from( text.attrs ) ).to.deep.equal( attrs );
  18. } );
  19. } );
  20. } );