|
|
@@ -15,7 +15,7 @@ import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
|
|
|
import log from '/ckeditor5/utils/log.js';
|
|
|
|
|
|
let editor;
|
|
|
-let PluginA, PluginB, PluginC, PluginD, PluginE, PluginF, PluginG;
|
|
|
+let PluginA, PluginB, PluginC, PluginD, PluginE, PluginF, PluginG, PluginH, PluginI;
|
|
|
class TestError extends Error {}
|
|
|
|
|
|
testUtils.createSinonSandbox();
|
|
|
@@ -28,11 +28,14 @@ before( () => {
|
|
|
PluginE = createPlugin( 'E' );
|
|
|
PluginF = createPlugin( 'F' );
|
|
|
PluginG = createPlugin( 'G', Creator );
|
|
|
+ PluginH = createPlugin( 'H' );
|
|
|
+ PluginI = createPlugin( 'I' );
|
|
|
|
|
|
PluginC.requires = [ PluginB ];
|
|
|
PluginD.requires = [ PluginA, PluginC ];
|
|
|
PluginF.requires = [ PluginE ];
|
|
|
PluginE.requires = [ PluginF ];
|
|
|
+ PluginH.requires = [ PluginI ];
|
|
|
|
|
|
editor = new Editor( document.body.appendChild( document.createElement( 'div' ) ) );
|
|
|
} );
|
|
|
@@ -67,6 +70,14 @@ moduleUtils.define( 'G/G', () => {
|
|
|
return PluginG;
|
|
|
} );
|
|
|
|
|
|
+moduleUtils.define( 'H/H', () => {
|
|
|
+ return PluginH;
|
|
|
+} );
|
|
|
+
|
|
|
+moduleUtils.define( 'I/I', () => {
|
|
|
+ return PluginI;
|
|
|
+} );
|
|
|
+
|
|
|
// Erroneous cases.
|
|
|
|
|
|
moduleUtils.define( 'X/X', () => {
|
|
|
@@ -175,6 +186,15 @@ describe( 'load', () => {
|
|
|
} );
|
|
|
} );
|
|
|
|
|
|
+ it( 'should make plugin available to get by name when plugin was loaded as dependency first', () => {
|
|
|
+ let plugins = new PluginCollection( editor );
|
|
|
+
|
|
|
+ return plugins.load( [ 'H', 'I' ] )
|
|
|
+ .then( () => {
|
|
|
+ expect( plugins.get( 'I' ) ).to.be.instanceof( PluginI );
|
|
|
+ } );
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'should set the `editor` property on loaded plugins', () => {
|
|
|
let plugins = new PluginCollection( editor );
|
|
|
|