editoruiview.js 895 B

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