浏览代码

Fix tests for Mention feature.

Maciej Gołaszewski 6 年之前
父节点
当前提交
6593c5e55d
共有 2 个文件被更改,包括 5 次插入14 次删除
  1. 0 14
      packages/ckeditor5-mention/src/mentionui.js
  2. 5 0
      packages/ckeditor5-mention/tests/mention.js

+ 0 - 14
packages/ckeditor5-mention/src/mentionui.js

@@ -11,7 +11,6 @@ import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import mix from '@ckeditor/ckeditor5-utils/src/mix';
 import mix from '@ckeditor/ckeditor5-utils/src/mix';
 import EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';
 import EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';
 import View from '@ckeditor/ckeditor5-ui/src/view';
 import View from '@ckeditor/ckeditor5-ui/src/view';
-import ContextualBalloon from '@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon';
 import ListView from '@ckeditor/ckeditor5-ui/src/list/listview';
 import ListView from '@ckeditor/ckeditor5-ui/src/list/listview';
 import ListItemView from '@ckeditor/ckeditor5-ui/src/list/listitemview';
 import ListItemView from '@ckeditor/ckeditor5-ui/src/list/listitemview';
 import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
 import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
@@ -34,29 +33,18 @@ export default class MentionUI extends Plugin {
 	/**
 	/**
 	 * @inheritDoc
 	 * @inheritDoc
 	 */
 	 */
-	static get requries() {
-		return [ ContextualBalloon ];
-	}
-
-	/**
-	 * @inheritDoc
-	 */
 	init() {
 	init() {
 		const editor = this.editor;
 		const editor = this.editor;
 
 
 		const locale = editor.locale;
 		const locale = editor.locale;
 
 
-		// this._panel = editor.plugins.get( 'ContextualBalloon' );
-
 		this._panel = new BalloonPanelView( locale );
 		this._panel = new BalloonPanelView( locale );
 		this._panel.withArrow = false;
 		this._panel.withArrow = false;
 		this._panel.render();
 		this._panel.render();
 
 
-		// document.body.appendChild( this._panel.element );
 		this.editor.ui.view.body.add( this._panel );
 		this.editor.ui.view.body.add( this._panel );
 
 
 		this._mentions = new MentionsView( locale );
 		this._mentions = new MentionsView( locale );
-		// this._mentions.render();
 
 
 		const items = new Collection();
 		const items = new Collection();
 
 
@@ -216,8 +204,6 @@ class TextWatcher {
 				this.fire( 'matched', { text } );
 				this.fire( 'matched', { text } );
 			}
 			}
 		} );
 		} );
-
-		this._panel = this.editor.plugins.get( 'ContextualBalloon' );
 	}
 	}
 
 
 	_getText() {
 	_getText() {

+ 5 - 0
packages/ckeditor5-mention/tests/mention.js

@@ -8,6 +8,7 @@ import global from '@ckeditor/ckeditor5-utils/src/dom/global';
 
 
 import Mention from '../src/mention';
 import Mention from '../src/mention';
 import MentionEditing from '../src/mentionediting';
 import MentionEditing from '../src/mentionediting';
+import MentionUI from '../src/mentionui';
 
 
 describe( 'Mention', () => {
 describe( 'Mention', () => {
 	let editorElement, editor;
 	let editorElement, editor;
@@ -42,4 +43,8 @@ describe( 'Mention', () => {
 	it( 'should load MentionEditing plugin', () => {
 	it( 'should load MentionEditing plugin', () => {
 		expect( editor.plugins.get( MentionEditing ) ).to.instanceOf( MentionEditing );
 		expect( editor.plugins.get( MentionEditing ) ).to.instanceOf( MentionEditing );
 	} );
 	} );
+
+	it( 'should load MentionUI plugin', () => {
+		expect( editor.plugins.get( MentionUI ) ).to.instanceOf( MentionUI );
+	} );
 } );
 } );