| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- /**
- * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
- import BalloonToolbarEditorUIView from '../src/balloontoolbareditoruiview';
- import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview';
- import Locale from '@ckeditor/ckeditor5-utils/src/locale';
- describe( 'BalloonToolbarEditorUIView', () => {
- let locale, view;
- beforeEach( () => {
- locale = new Locale( 'en' );
- view = new BalloonToolbarEditorUIView( locale );
- } );
- describe( 'constructor()', () => {
- describe( '#editable', () => {
- it( 'is created', () => {
- expect( view.editable ).to.be.instanceof( InlineEditableUIView );
- } );
- it( 'is given a locate object', () => {
- expect( view.editable.locale ).to.equal( locale );
- } );
- it( 'is registered as a child', () => {
- const spy = sinon.spy( view.editable, 'destroy' );
- return view.init()
- .then( () => view.destroy() )
- .then( () => {
- sinon.assert.calledOnce( spy );
- } );
- } );
- } );
- } );
- describe( 'editableElement', () => {
- it( 'returns editable\'s view element', () => {
- return view.init()
- .then( () => {
- expect( view.editableElement.getAttribute( 'contentEditable' ) ).to.equal( 'true' );
- } )
- .then( () => view.destroy() );
- } );
- } );
- } );
|