editoruiview.js 840 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals document */
  6. import EditorUIView from '/ckeditor5/ui/editorui/editoruiview.js';
  7. describe( 'EditorUIView', () => {
  8. let editorUIView;
  9. beforeEach( () => {
  10. editorUIView = new EditorUIView();
  11. return editorUIView.init();
  12. } );
  13. describe( 'constructor', () => {
  14. it( 'creates the body region', () => {
  15. const el = editorUIView.regions.get( 'body' ).element;
  16. expect( el.parentNode ).to.equal( document.body );
  17. expect( el.nextSibling ).to.be.null;
  18. } );
  19. } );
  20. describe( 'destroy', () => {
  21. it( 'removes the body region container', () => {
  22. const el = editorUIView.regions.get( 'body' ).element;
  23. editorUIView.destroy();
  24. expect( el.parentNode ).to.be.null;
  25. } );
  26. } );
  27. } );