Browse Source

WIP - changing errors.

Maciej Bukowski 6 years ago
parent
commit
19676e807f
2 changed files with 1226 additions and 1221 deletions
  1. 4 3
      packages/ckeditor5-mention/tests/mentioncommand.js
  2. 1222 1218
      packages/ckeditor5-mention/tests/mentionui.js

+ 4 - 3
packages/ckeditor5-mention/tests/mentioncommand.js

@@ -7,7 +7,8 @@ import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltestedit
 import { setData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 
 import MentionCommand from '../src/mentioncommand';
-import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+
+import { expectToThrowCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
 
 describe( 'MentionCommand', () => {
 	let editor, command, model, doc, selection;
@@ -145,7 +146,7 @@ describe( 'MentionCommand', () => {
 			];
 
 			for ( const options of testCases ) {
-				expect( () => command.execute( options ) ).to.throw( CKEditorError, /mentioncommand-incorrect-marker/ );
+				expectToThrowCKEditorError( () => command.execute( options ), /mentioncommand-incorrect-marker/, editor );
 			}
 		} );
 
@@ -159,7 +160,7 @@ describe( 'MentionCommand', () => {
 			];
 
 			for ( const options of testCases ) {
-				expect( () => command.execute( options ) ).to.throw( CKEditorError, /mentioncommand-incorrect-id/ );
+				expectToThrowCKEditorError( () => command.execute( options ), /mentioncommand-incorrect-id/, editor );
 			}
 		} );
 	} );

File diff suppressed because it is too large
+ 1222 - 1218
packages/ckeditor5-mention/tests/mentionui.js