|
@@ -4,7 +4,8 @@
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
import InlineEditorUIView from '../src/inlineeditoruiview';
|
|
import InlineEditorUIView from '../src/inlineeditoruiview';
|
|
|
-import FloatingToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/floating/floatingtoolbarview';
|
|
|
|
|
|
|
+import ToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarview';
|
|
|
|
|
+import FloatingPanelView from '@ckeditor/ckeditor5-ui/src/panel/floating/floatingpanelview';
|
|
|
import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview';
|
|
import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview';
|
|
|
import Locale from '@ckeditor/ckeditor5-utils/src/locale';
|
|
import Locale from '@ckeditor/ckeditor5-utils/src/locale';
|
|
|
|
|
|
|
@@ -19,15 +20,29 @@ describe( 'InlineEditorUIView', () => {
|
|
|
describe( 'constructor()', () => {
|
|
describe( 'constructor()', () => {
|
|
|
describe( '#toolbar', () => {
|
|
describe( '#toolbar', () => {
|
|
|
it( 'is created', () => {
|
|
it( 'is created', () => {
|
|
|
- expect( view.toolbar ).to.be.instanceof( FloatingToolbarView );
|
|
|
|
|
|
|
+ expect( view.toolbar ).to.be.instanceof( ToolbarView );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
- it( 'is given a locate object', () => {
|
|
|
|
|
|
|
+ it( 'is given a locale object', () => {
|
|
|
expect( view.toolbar.locale ).to.equal( locale );
|
|
expect( view.toolbar.locale ).to.equal( locale );
|
|
|
} );
|
|
} );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ describe( '#panel', () => {
|
|
|
|
|
+ it( 'is created', () => {
|
|
|
|
|
+ expect( view.panel ).to.be.instanceof( FloatingPanelView );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'is given a locale object', () => {
|
|
|
|
|
+ expect( view.panel.locale ).to.equal( locale );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'is given the right CSS class', () => {
|
|
|
|
|
+ expect( view.panel.element.classList.contains( 'ck-toolbar__container' ) ).to.be.true;
|
|
|
|
|
+ } );
|
|
|
|
|
|
|
|
- it( 'is put into the "top" collection', () => {
|
|
|
|
|
- expect( view.body.get( 0 ) ).to.equal( view.toolbar );
|
|
|
|
|
|
|
+ it( 'is put into the #body collection', () => {
|
|
|
|
|
+ expect( view.body.get( 0 ) ).to.equal( view.panel );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -52,6 +67,18 @@ describe( 'InlineEditorUIView', () => {
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
|
|
+ describe( 'init', () => {
|
|
|
|
|
+ it( 'appends #toolbar to panel#content', () => {
|
|
|
|
|
+ expect( view.panel.content ).to.have.length( 0 );
|
|
|
|
|
+
|
|
|
|
|
+ return view.init()
|
|
|
|
|
+ .then( () => {
|
|
|
|
|
+ expect( view.panel.content.get( 0 ) ).to.equal( view.toolbar );
|
|
|
|
|
+ } )
|
|
|
|
|
+ .then( () => view.destroy() );
|
|
|
|
|
+ } );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
describe( 'editableElement', () => {
|
|
describe( 'editableElement', () => {
|
|
|
it( 'returns editable\'s view element', () => {
|
|
it( 'returns editable\'s view element', () => {
|
|
|
return view.init()
|
|
return view.init()
|