mediaembed.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
  6. import MediaEmbed from '../src/mediaembed';
  7. import MediaEmbedEditing from '../src/mediaembedediting';
  8. import MediaEmbedUI from '../src/mediaembedui';
  9. import Widget from '@ckeditor/ckeditor5-widget/src/widget';
  10. import global from '@ckeditor/ckeditor5-utils/src/dom/global';
  11. describe( 'MediaEmbed', () => {
  12. let editorElement, editor;
  13. beforeEach( () => {
  14. editorElement = global.document.createElement( 'div' );
  15. global.document.body.appendChild( editorElement );
  16. return ClassicTestEditor
  17. .create( editorElement, {
  18. plugins: [ MediaEmbed ]
  19. } )
  20. .then( newEditor => {
  21. editor = newEditor;
  22. } );
  23. } );
  24. afterEach( () => {
  25. editorElement.remove();
  26. return editor.destroy();
  27. } );
  28. it( 'should be loaded', () => {
  29. expect( editor.plugins.get( MediaEmbed ) ).to.instanceOf( MediaEmbed );
  30. } );
  31. it( 'should load MediaEmbedEditing plugin', () => {
  32. expect( editor.plugins.get( MediaEmbedEditing ) ).to.instanceOf( MediaEmbedEditing );
  33. } );
  34. it( 'should load Widget plugin', () => {
  35. expect( editor.plugins.get( Widget ) ).to.instanceOf( Widget );
  36. } );
  37. it( 'should load MediaEmbedUI plugin', () => {
  38. expect( editor.plugins.get( MediaEmbedUI ) ).to.instanceOf( MediaEmbedUI );
  39. } );
  40. it( 'has proper name', () => {
  41. expect( MediaEmbed.pluginName ).to.equal( 'MediaEmbed' );
  42. } );
  43. } );