8
0

containerelement.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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 ContainerElement from '/ckeditor5/engine/treeview/containerelement.js';
  8. import Element from '/ckeditor5/engine/treeview/element.js';
  9. import { parse } from '/tests/engine/_utils/view.js';
  10. describe( 'ContainerElement', () => {
  11. describe( 'constructor', () => {
  12. it( 'should create element with default priority', () => {
  13. const el = new ContainerElement( 'p' );
  14. expect( el ).to.be.an.instanceof( ContainerElement );
  15. expect( el ).to.be.an.instanceof( Element );
  16. expect( el ).to.have.property( 'name' ).that.equals( 'p' );
  17. } );
  18. } );
  19. describe( 'getBlockFillerOffset', () => {
  20. it( 'should return position 0 if element is empty', () => {
  21. expect( parse( '<container:p></container:p>' ).getBlockFillerOffset() ).to.equals( 0 );
  22. } );
  23. it( 'should return null if element is not empty', () => {
  24. expect( parse( '<container:p>foo</container:p>' ).getBlockFillerOffset() ).to.be.null;
  25. } );
  26. } );
  27. } );