mention.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * @license Copyright (c) 2003-2019, 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 global from '@ckeditor/ckeditor5-utils/src/dom/global';
  7. import Mention from '../src/mention';
  8. import MentionEditing from '../src/mentionediting';
  9. import MentionUI from '../src/mentionui';
  10. describe( 'Mention', () => {
  11. let editorElement, editor;
  12. beforeEach( () => {
  13. editorElement = global.document.createElement( 'div' );
  14. global.document.body.appendChild( editorElement );
  15. return ClassicTestEditor
  16. .create( editorElement, {
  17. plugins: [ Mention ]
  18. } )
  19. .then( newEditor => {
  20. editor = newEditor;
  21. } );
  22. } );
  23. afterEach( () => {
  24. editorElement.remove();
  25. return editor.destroy();
  26. } );
  27. it( 'should be loaded', () => {
  28. expect( editor.plugins.get( Mention ) ).to.instanceOf( Mention );
  29. } );
  30. it( 'has proper name', () => {
  31. expect( Mention.pluginName ).to.equal( 'Mention' );
  32. } );
  33. it( 'should load MentionEditing plugin', () => {
  34. expect( editor.plugins.get( MentionEditing ) ).to.instanceOf( MentionEditing );
  35. } );
  36. it( 'should load MentionUI plugin', () => {
  37. expect( editor.plugins.get( MentionUI ) ).to.instanceOf( MentionUI );
  38. } );
  39. } );