boxededitorui.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 Editor from '/ckeditor5/editor/editor.js';
  7. import BoxedEditorUI from '/ckeditor5/ui/editorui/boxed/boxededitorui.js';
  8. import ControllerCollection from '/ckeditor5/ui/controllercollection.js';
  9. describe( 'BoxedEditorUI', () => {
  10. let editor, boxedEditorUI;
  11. beforeEach( () => {
  12. editor = new Editor( null, {
  13. ui: {
  14. width: 100,
  15. height: 200
  16. }
  17. } );
  18. boxedEditorUI = new BoxedEditorUI( editor );
  19. } );
  20. describe( 'constructor', () => {
  21. it( 'adds controller collections', () => {
  22. expect( boxedEditorUI.collections.get( 'top' ) ).to.be.instanceof( ControllerCollection );
  23. expect( boxedEditorUI.collections.get( 'main' ) ).to.be.instanceof( ControllerCollection );
  24. } );
  25. it( 'sets "width" and "height" attributes', () => {
  26. expect( boxedEditorUI.width ).to.equal( editor.config.get( 'ui.width' ) );
  27. expect( boxedEditorUI.height ).to.equal( editor.config.get( 'ui.height' ) );
  28. } );
  29. } );
  30. describe( 'viewModel', () => {
  31. it( 'points to the BoxedEditorUI instance', () => {
  32. expect( boxedEditorUI.viewModel ).to.equal( boxedEditorUI );
  33. } );
  34. } );
  35. } );