button.js 737 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* bender-tags: ui, button */
  6. 'use strict';
  7. import Button from '/ckeditor5/core/ui/button/button.js';
  8. import View from '/ckeditor5/core/ui/view.js';
  9. import Model from '/ckeditor5/core/ui/model.js';
  10. describe( 'Button', () => {
  11. let model, button, view;
  12. beforeEach( () => {
  13. model = new Model();
  14. view = new View();
  15. button = new Button( model, view );
  16. } );
  17. describe( 'constructor', () => {
  18. it( 'creates view#click -> model#execute binding', () => {
  19. const spy = sinon.spy();
  20. model.on( 'execute', spy );
  21. view.fire( 'click' );
  22. expect( spy.calledOnce ).to.be.true;
  23. } );
  24. } );
  25. } );