8
0

text.js 796 B

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