mediaembed.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  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 AutoMediaEmbed from '../src/automediaembed';
  10. import Widget from '@ckeditor/ckeditor5-widget/src/widget';
  11. import global from '@ckeditor/ckeditor5-utils/src/dom/global';
  12. describe( 'MediaEmbed', () => {
  13. let editorElement, editor;
  14. beforeEach( () => {
  15. editorElement = global.document.createElement( 'div' );
  16. global.document.body.appendChild( editorElement );
  17. return ClassicTestEditor
  18. .create( editorElement, {
  19. plugins: [ MediaEmbed ]
  20. } )
  21. .then( newEditor => {
  22. editor = newEditor;
  23. } );
  24. } );
  25. afterEach( () => {
  26. editorElement.remove();
  27. return editor.destroy();
  28. } );
  29. it( 'should be loaded', () => {
  30. expect( editor.plugins.get( MediaEmbed ) ).to.instanceOf( MediaEmbed );
  31. } );
  32. it( 'should load MediaEmbedEditing plugin', () => {
  33. expect( editor.plugins.get( MediaEmbedEditing ) ).to.instanceOf( MediaEmbedEditing );
  34. } );
  35. it( 'should load Widget plugin', () => {
  36. expect( editor.plugins.get( Widget ) ).to.instanceOf( Widget );
  37. } );
  38. it( 'should load MediaEmbedUI plugin', () => {
  39. expect( editor.plugins.get( MediaEmbedUI ) ).to.instanceOf( MediaEmbedUI );
  40. } );
  41. it( 'should load AutoMediaEmbed plugin', () => {
  42. expect( editor.plugins.get( AutoMediaEmbed ) ).to.instanceOf( AutoMediaEmbed );
  43. } );
  44. it( 'has proper name', () => {
  45. expect( MediaEmbed.pluginName ).to.equal( 'MediaEmbed' );
  46. } );
  47. } );