Browse Source

Make sure two instances of MediaEmbed dropdown are created and different from each other.

As suggested at https://github.com/ckeditor/ckeditor5-media-embed/pull/98#pullrequestreview-397657148
Tomek Wytrębowicz 5 years ago
parent
commit
9dd2156f43
1 changed files with 4 additions and 1 deletions
  1. 4 1
      packages/ckeditor5-media-embed/tests/mediaembedui.js

+ 4 - 1
packages/ckeditor5-media-embed/tests/mediaembedui.js

@@ -54,9 +54,12 @@ describe( 'MediaEmbedUI', () => {
 	} );
 
 	it( 'should allow creating two instances', () => {
+		let secondInstance;
+
 		expect( function createSecondInstance() {
-			editor.ui.componentFactory.create( 'mediaEmbed' );
+			secondInstance = editor.ui.componentFactory.create( 'mediaEmbed' );
 		} ).not.to.throw();
+		expect( dropdown ).to.be.not.equal( secondInstance );
 	} );
 
 	describe( 'dropdown', () => {