text.js 712 B

123456789101112131415161718192021222324
  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. describe( 'Text', () => {
  10. describe( 'constructor', () => {
  11. it( 'should create character without attributes', () => {
  12. let attrs = [ new Attribute( 'bold', true ) ];
  13. let text = new Text( 'bar', attrs );
  14. expect( text ).to.have.property( 'text' ).that.equals( 'bar' );
  15. expect( text ).to.have.property( 'attrs' ).that.is.an( 'array' );
  16. expect( text.attrs ).to.be.deep.equals( attrs );
  17. } );
  18. } );
  19. } );