|
|
@@ -6,17 +6,18 @@
|
|
|
/* globals console */
|
|
|
|
|
|
import Locale from '../src/locale';
|
|
|
-import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
|
|
|
|
|
|
describe( 'Locale', () => {
|
|
|
let locale;
|
|
|
|
|
|
- testUtils.createSinonSandbox();
|
|
|
-
|
|
|
beforeEach( () => {
|
|
|
locale = new Locale();
|
|
|
} );
|
|
|
|
|
|
+ afterEach( () => {
|
|
|
+ sinon.restore();
|
|
|
+ } );
|
|
|
+
|
|
|
describe( 'constructor', () => {
|
|
|
it( 'sets the #language', () => {
|
|
|
const locale = new Locale( {
|
|
|
@@ -149,11 +150,14 @@ describe( 'Locale', () => {
|
|
|
|
|
|
describe( 'language()', () => {
|
|
|
it( 'should return #uiLanguage', () => {
|
|
|
+ const stub = sinon.stub( console, 'warn' );
|
|
|
+
|
|
|
expect( locale.language ).to.equal( locale.uiLanguage );
|
|
|
+ sinon.assert.calledWithMatch( stub, 'locale-deprecated-language-property' );
|
|
|
} );
|
|
|
|
|
|
it( 'should warn about deprecation', () => {
|
|
|
- const stub = testUtils.sinon.stub( console, 'warn' );
|
|
|
+ const stub = sinon.stub( console, 'warn' );
|
|
|
|
|
|
expect( locale.language ).to.equal( 'en' );
|
|
|
sinon.assert.calledWithMatch( stub, 'locale-deprecated-language-property' );
|