mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-27 02:38:18 +00:00
add tests
This commit is contained in:
parent
71fb19861d
commit
9ea0a3fe66
17
src/utils/__tests__/l10n.js
Normal file
17
src/utils/__tests__/l10n.js
Normal file
@ -0,0 +1,17 @@
|
||||
import * as utils from '../l10n';
|
||||
|
||||
describe('l10n utils: getInitialLocale', () => {
|
||||
it('default lang', () => {
|
||||
expect(utils.getInitialLocale(0)).toBe('en');
|
||||
expect(utils.getInitialLocale(null)).toBe('en');
|
||||
expect(utils.getInitialLocale(undefined)).toBe('en');
|
||||
expect(utils.getInitialLocale('dadada')).toBe('en');
|
||||
expect(utils.getInitialLocale('')).toBe('en');
|
||||
});
|
||||
|
||||
it('browser locales', () => {
|
||||
expect(utils.getInitialLocale('zh')).toBe('zh');
|
||||
expect(utils.getInitialLocale('cs-CZ')).toBe('cs');
|
||||
expect(utils.getInitialLocale('en_GB')).toBe('en');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user