|
5 | 5 |
|
6 | 6 | /* globals document, Event */
|
7 | 7 |
|
8 |
| -import ComponentFactory from '@ckeditor/ckeditor5-ui/src/componentfactory'; |
9 | 8 | import View from '@ckeditor/ckeditor5-ui/src/view';
|
10 | 9 |
|
11 | 10 | import InlineEditorUI from '../src/inlineeditorui';
|
| 11 | +import EditorUI from '@ckeditor/ckeditor5-core/src/editor/editorui'; |
12 | 12 | import InlineEditorUIView from '../src/inlineeditoruiview';
|
13 | 13 | import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
|
14 | 14 |
|
15 |
| -import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker'; |
16 |
| - |
17 | 15 | import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';
|
18 | 16 | import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
|
19 | 17 | import utils from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
|
@@ -41,20 +39,8 @@ describe( 'InlineEditorUI', () => {
|
41 | 39 | } );
|
42 | 40 |
|
43 | 41 | describe( 'constructor()', () => {
|
44 |
| - it( 'sets #editor', () => { |
45 |
| - expect( ui.editor ).to.equal( editor ); |
46 |
| - } ); |
47 |
| - |
48 |
| - it( 'sets #view', () => { |
49 |
| - expect( ui.view ).to.equal( view ); |
50 |
| - } ); |
51 |
| - |
52 |
| - it( 'creates #componentFactory factory', () => { |
53 |
| - expect( ui.componentFactory ).to.be.instanceOf( ComponentFactory ); |
54 |
| - } ); |
55 |
| - |
56 |
| - it( 'creates #focusTracker', () => { |
57 |
| - expect( ui.focusTracker ).to.be.instanceOf( FocusTracker ); |
| 42 | + it( 'extends EditorUI', () => { |
| 43 | + expect( ui ).to.instanceof( EditorUI ); |
58 | 44 | } );
|
59 | 45 | } );
|
60 | 46 |
|
@@ -94,17 +80,17 @@ describe( 'InlineEditorUI', () => {
|
94 | 80 | } );
|
95 | 81 |
|
96 | 82 | // https://github.com/ckeditor/ckeditor5-editor-inline/issues/4
|
97 |
| - it( 'pin() is called on editor.editable.view#render', () => { |
| 83 | + it( 'pin() is called on editor.ui#update', () => { |
98 | 84 | const spy = sinon.stub( view.panel, 'pin' );
|
99 | 85 |
|
100 | 86 | view.panel.hide();
|
101 | 87 |
|
102 |
| - editor.editing.view.render(); |
| 88 | + editor.ui.fire( 'update' ); |
103 | 89 | sinon.assert.notCalled( spy );
|
104 | 90 |
|
105 | 91 | view.panel.show();
|
106 | 92 |
|
107 |
| - editor.editing.view.render(); |
| 93 | + editor.ui.fire( 'update' ); |
108 | 94 | sinon.assert.calledOnce( spy );
|
109 | 95 | sinon.assert.calledWithExactly( spy, {
|
110 | 96 | target: view.editableElement,
|
@@ -212,17 +198,6 @@ describe( 'InlineEditorUI', () => {
|
212 | 198 | } );
|
213 | 199 | } );
|
214 | 200 | } );
|
215 |
| - |
216 |
| - describe( 'destroy()', () => { |
217 |
| - it( 'destroys the #view', () => { |
218 |
| - const spy = sinon.spy( view, 'destroy' ); |
219 |
| - |
220 |
| - return editor.destroy() |
221 |
| - .then( () => { |
222 |
| - sinon.assert.calledOnce( spy ); |
223 |
| - } ); |
224 |
| - } ); |
225 |
| - } ); |
226 | 201 | } );
|
227 | 202 |
|
228 | 203 | function viewCreator( name ) {
|
|
0 commit comments