From 6d884510ccd91e811a07f37e083d20744d141b8a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 25 Oct 2022 14:07:57 +0400 Subject: [PATCH] Update i18n --- test/specs/i18n/index.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/specs/i18n/index.js b/test/specs/i18n/index.js index 20b93acbc..318889664 100644 --- a/test/specs/i18n/index.js +++ b/test/specs/i18n/index.js @@ -7,9 +7,14 @@ describe('I18n', () => { let editor = new Editor(); let em = editor.getModel(); + const newModuleWithConfig = i18n => { + const editor = new Editor({ i18n }); + const em = editor.getModel(); + return new I18n(em); + }; + beforeEach(() => { - obj = new I18n(); - obj.init({ em }); + obj = new I18n(em); }); test('Object exists', () => { @@ -28,8 +33,7 @@ describe('I18n', () => { const locale = 'it'; const localeFallback = 'it'; const msg = 'Hello!!!'; - obj.init({ - em, + obj = newModuleWithConfig({ locale, localeFallback, detectLocale: 0, @@ -43,7 +47,7 @@ describe('I18n', () => { }); test('English always imported', () => { - obj.init({ + obj = newModuleWithConfig({ messages: { it: {} }, }); expect(Object.keys(obj.getMessages())).toEqual(['en', 'it']);