We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fdb51a commit f20c4ebCopy full SHA for f20c4eb
test/common/lang/LangSpec.js
@@ -0,0 +1,23 @@
1
+import { Lang } from '../../../src/common/lang/Lang';
2
+
3
+describe('Lang', () => {
4
+ const originCookie = window.document.cookie;
5
+ afterAll(() => {
6
+ window.document.cookie = originCookie;
7
+ });
8
+ afterEach(() => {
9
+ Lang.code = null;
10
11
+ it('getLang_nocookie', () => {
12
+ window.document.cookie = '';
13
+ expect(Lang.getCode()).toBe('zh-CN');
14
15
+ it('getLang_zh-CN', () => {
16
+ window.document.cookie = 'language=en-US';
17
+ expect(Lang.getCode()).toBe('en-US');
18
19
+ it('getLang_zh', () => {
20
+ window.document.cookie = 'language=zh';
21
22
23
+});
0 commit comments