1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-27 10:48:22 +00:00

add tests

This commit is contained in:
slowbackspace 2019-04-12 17:24:15 +02:00
parent 71fb19861d
commit 9ea0a3fe66

View 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');
});
});