|
@@ -5,11 +5,14 @@
|
|
|
|
|
|
|
|
'use strict';
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
+import testUtils from '/tests/ckeditor5/_utils/utils.js';
|
|
|
import Editor from '/ckeditor5/editor.js';
|
|
import Editor from '/ckeditor5/editor.js';
|
|
|
import EditorUI from '/ckeditor5/ui/editorui/editorui.js';
|
|
import EditorUI from '/ckeditor5/ui/editorui/editorui.js';
|
|
|
import ComponentFactory from '/ckeditor5/ui/componentfactory.js';
|
|
import ComponentFactory from '/ckeditor5/ui/componentfactory.js';
|
|
|
import ControllerCollection from '/ckeditor5/ui/controllercollection.js';
|
|
import ControllerCollection from '/ckeditor5/ui/controllercollection.js';
|
|
|
|
|
|
|
|
|
|
+testUtils.createSinonSandbox();
|
|
|
|
|
+
|
|
|
describe( 'EditorUI', () => {
|
|
describe( 'EditorUI', () => {
|
|
|
let editor, editorUI;
|
|
let editor, editorUI;
|
|
|
|
|
|
|
@@ -31,4 +34,24 @@ describe( 'EditorUI', () => {
|
|
|
expect( editor ).to.have.property( 'ui', editorUI );
|
|
expect( editor ).to.have.property( 'ui', editorUI );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
+
|
|
|
|
|
+ describe( 'init', () => {
|
|
|
|
|
+ it( 'calls _setupIconManager when "icon" in model', () => {
|
|
|
|
|
+ const spy = testUtils.sinon.spy( editorUI, '_setupIconManager' );
|
|
|
|
|
+
|
|
|
|
|
+ return editorUI.init()
|
|
|
|
|
+ .then( () => {
|
|
|
|
|
+ expect( spy.calledOnce ).to.be.true;
|
|
|
|
|
+ } );
|
|
|
|
|
+ } );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ describe( '_setupIconManager', () => {
|
|
|
|
|
+ it( 'sets "icon" property', () => {
|
|
|
|
|
+ editorUI._setupIconManager();
|
|
|
|
|
+
|
|
|
|
|
+ expect( editorUI.icons ).to.be.an( 'array' );
|
|
|
|
|
+ expect( editorUI.icons ).to.not.be.empty;
|
|
|
|
|
+ } );
|
|
|
|
|
+ } );
|
|
|
} );
|
|
} );
|