mentionediting.js 914 B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
  6. import MentionEditing from '../src/mentionediting';
  7. import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
  8. describe( 'MentionEditing', () => {
  9. testUtils.createSinonSandbox();
  10. it( 'should be named', () => {
  11. expect( MentionEditing.pluginName ).to.equal( 'MentionEditing' );
  12. } );
  13. describe( 'init()', () => {
  14. it( 'should be loaded', () => {
  15. return createTestEditor()
  16. .then( newEditor => {
  17. expect( newEditor.plugins.get( MentionEditing ) ).to.be.instanceOf( MentionEditing );
  18. } );
  19. } );
  20. } );
  21. function createTestEditor( mentionConfig ) {
  22. return VirtualTestEditor
  23. .create( {
  24. plugins: [ MentionEditing ],
  25. mention: mentionConfig
  26. } );
  27. }
  28. } );