8
0

text.js 811 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* bender-tags: treeview */
  6. 'use strict';
  7. import ViewNode from '/ckeditor5/core/treeview/node.js';
  8. import ViewText from '/ckeditor5/core/treeview/text.js';
  9. describe( 'Element', () => {
  10. describe( 'constructor', () => {
  11. it( 'should create element without attributes', () => {
  12. const text = new ViewText( 'foo' );
  13. expect( text ).to.be.an.instanceof( ViewNode );
  14. expect( text.data ).to.equal( 'foo' );
  15. expect( text ).to.have.property( 'parent' ).that.is.null;
  16. } );
  17. } );
  18. describe( 'setText', () => {
  19. it( 'should change the text', () => {
  20. const text = new ViewText( 'foo' );
  21. text.data = 'bar';
  22. expect( text.data ).to.equal( 'bar' );
  23. } );
  24. } );
  25. } );