Skip to content

Commit 24ea021

Browse files
committed
test(cloud-function): test zh-Hans/zh-Hant locales
1 parent 002fca8 commit 24ea021

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

cloud-function/src/internal/locale-utils/index.test.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,34 @@ describe("getLocale", () => {
7272
);
7373
});
7474

75+
it("resolves zh-Hant to zh-TW", () => {
76+
strictEqual(
77+
getLocale(makeRequest({ acceptLanguage: "zh-Hant" }), {}),
78+
"zh-TW"
79+
);
80+
});
81+
82+
it("resolves zh-Hant-TW to zh-TW", () => {
83+
strictEqual(
84+
getLocale(makeRequest({ acceptLanguage: "zh-Hant-TW" }), {}),
85+
"zh-TW"
86+
);
87+
});
88+
89+
it("resolves zh-Hans to zh-CN", () => {
90+
strictEqual(
91+
getLocale(makeRequest({ acceptLanguage: "zh-Hans" }), {}),
92+
"zh-CN"
93+
);
94+
});
95+
96+
it("resolves zh-Hans-CN to zh-CN", () => {
97+
strictEqual(
98+
getLocale(makeRequest({ acceptLanguage: "zh-Hans-CN" }), {}),
99+
"zh-CN"
100+
);
101+
});
102+
75103
it("respects quality values to pick zh-TW over zh-CN", () => {
76104
strictEqual(
77105
getLocale(

0 commit comments

Comments
 (0)