containerelement.js 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* bender-tags: view, browser-only */
  6. import ContainerElement from '/ckeditor5/engine/view/containerelement.js';
  7. import Element from '/ckeditor5/engine/view/element.js';
  8. import { parse } from '/tests/engine/_utils/view.js';
  9. describe( 'ContainerElement', () => {
  10. describe( 'constructor', () => {
  11. it( 'should create element with default priority', () => {
  12. const el = new ContainerElement( 'p' );
  13. expect( el ).to.be.an.instanceof( ContainerElement );
  14. expect( el ).to.be.an.instanceof( Element );
  15. expect( el ).to.have.property( 'name' ).that.equals( 'p' );
  16. } );
  17. } );
  18. describe( 'getFillerOffset', () => {
  19. it( 'should return position 0 if element is empty', () => {
  20. expect( parse( '<container:p></container:p>' ).getFillerOffset() ).to.equals( 0 );
  21. } );
  22. it( 'should return null if element is not empty', () => {
  23. expect( parse( '<container:p>foo</container:p>' ).getFillerOffset() ).to.be.null;
  24. } );
  25. } );
  26. } );