-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move to @gravity-ui/i18n (#45)
* chore: bump @yandex-cloud/i18n * feat: move to @gravity-ui/i18n Co-authored-by: Алаев Евгений <alaev89@yandex-team.ru>
- Loading branch information
1 parent
e15f731
commit ad401d8
Showing
4 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,32 @@ | ||
import {DEFAULT_LOCALE_SPECIFICATION, settings} from '../settings'; | ||
|
||
const resetSettings = () => | ||
settings.set({ | ||
lang: 'en', | ||
locale: DEFAULT_LOCALE_SPECIFICATION, | ||
}); | ||
|
||
describe('libs/settings', () => { | ||
it('Default locale should be equal DEFAULT_LOCALE_SPECIFICATION', () => { | ||
const result = settings.get('locale'); | ||
expect(result).toBe(DEFAULT_LOCALE_SPECIFICATION); | ||
}); | ||
|
||
it('Default lang should be equal to en', () => { | ||
const result = settings.get('lang'); | ||
|
||
expect(result).toBe('en'); | ||
}); | ||
|
||
it('Changed lang should be equal to ru', () => { | ||
settings.set({ | ||
lang: 'ru', | ||
}); | ||
const result = settings.get('lang'); | ||
|
||
expect(result).toBe('ru'); | ||
}); | ||
|
||
beforeAll(resetSettings); | ||
afterEach(resetSettings); | ||
}); |