|
|
@@ -19,7 +19,6 @@ import log from '@ckeditor/ckeditor5-utils/src/log';
|
|
|
import env from '@ckeditor/ckeditor5-utils/src/env';
|
|
|
|
|
|
import MentionUI, { createRegExp } from '../src/mentionui';
|
|
|
-import featureDetection from '../src/featuredetection';
|
|
|
import MentionEditing from '../src/mentionediting';
|
|
|
import MentionsView from '../src/ui/mentionsview';
|
|
|
import { assertCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
|
|
|
@@ -450,10 +449,10 @@ describe( 'MentionUI', () => {
|
|
|
let regExpStub;
|
|
|
|
|
|
// Cache the original value to restore it after the tests.
|
|
|
- const originalGroupSupport = featureDetection.isUnicodeGroupSupported;
|
|
|
+ const originalGroupSupport = env.features.isRegExpUnicodePropertySupported;
|
|
|
|
|
|
before( () => {
|
|
|
- featureDetection.isUnicodeGroupSupported = false;
|
|
|
+ env.features.isRegExpUnicodePropertySupported = false;
|
|
|
} );
|
|
|
|
|
|
beforeEach( () => {
|
|
|
@@ -466,18 +465,18 @@ describe( 'MentionUI', () => {
|
|
|
} );
|
|
|
|
|
|
after( () => {
|
|
|
- featureDetection.isUnicodeGroupSupported = originalGroupSupport;
|
|
|
+ env.features.isRegExpUnicodePropertySupported = originalGroupSupport;
|
|
|
} );
|
|
|
|
|
|
it( 'returns a simplified RegExp for browsers not supporting Unicode punctuation groups', () => {
|
|
|
- featureDetection.isUnicodeGroupSupported = false;
|
|
|
+ env.features.isRegExpUnicodePropertySupported = false;
|
|
|
createRegExp( '@', 2 );
|
|
|
sinon.assert.calledOnce( regExpStub );
|
|
|
sinon.assert.calledWithExactly( regExpStub, '(?:^|[ \\(\\[{"\'])([@])([_a-zA-ZÀ-ž0-9]{2,})$', 'u' );
|
|
|
} );
|
|
|
|
|
|
it( 'returns a ES2018 RegExp for browsers supporting Unicode punctuation groups', () => {
|
|
|
- featureDetection.isUnicodeGroupSupported = true;
|
|
|
+ env.features.isRegExpUnicodePropertySupported = true;
|
|
|
createRegExp( '@', 2 );
|
|
|
sinon.assert.calledOnce( regExpStub );
|
|
|
sinon.assert.calledWithExactly( regExpStub, '(?:^|[ \\p{Ps}\\p{Pi}"\'])([@])([_\\p{L}\\p{N}]{2,})$', 'u' );
|
|
|
@@ -565,7 +564,7 @@ describe( 'MentionUI', () => {
|
|
|
// Belongs to Pi (Punctuation, Initial quote) group:
|
|
|
'«', '‹', '⸌', ' ⸂', '⸠'
|
|
|
] ) {
|
|
|
- testOpeningPunctuationCharacter( character, !featureDetection.isUnicodeGroupSupported );
|
|
|
+ testOpeningPunctuationCharacter( character, !env.features.isRegExpUnicodePropertySupported );
|
|
|
}
|
|
|
|
|
|
it( 'should not show panel for marker in the middle of other word', () => {
|
|
|
@@ -835,7 +834,7 @@ describe( 'MentionUI', () => {
|
|
|
} );
|
|
|
|
|
|
it( 'should open panel for unicode character ב', function() {
|
|
|
- if ( !featureDetection.isUnicodeGroupSupported ) {
|
|
|
+ if ( !env.features.isRegExpUnicodePropertySupported ) {
|
|
|
this.skip();
|
|
|
}
|
|
|
|