8
0

stickytoolbar.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* bender-tags: ui, stickytoolbar */
  6. 'use strict';
  7. import Editor from '/ckeditor5/editor.js';
  8. import Editable from '/ckeditor5/editable.js';
  9. import Model from '/ckeditor5/ui/model.js';
  10. import View from '/ckeditor5/ui/view.js';
  11. import StickyToolbar from '/ckeditor5/ui/bindings/stickytoolbar.js';
  12. describe( 'StickyToolbar', () => {
  13. let toolbar, view, model, editor, editable;
  14. beforeEach( () => {
  15. editor = new Editor();
  16. editable = new Editable( editor, 'foo' );
  17. model = new Model();
  18. view = new View( model );
  19. toolbar = new StickyToolbar( model, view, editor );
  20. } );
  21. describe( 'constructor', () => {
  22. it( 'binds model#isActive to editor.editables#current', () => {
  23. expect( model.isActive ).to.be.false;
  24. editor.editables.current = editable;
  25. expect( model.isActive ).to.be.true;
  26. editor.editables.current = null;
  27. expect( model.isActive ).to.be.false;
  28. } );
  29. } );
  30. } );