Open History to see the last commit
1import { describe, expect, it } from "vite-plus/test";
2
3import { resolveWebLocaleSelection } from "./locales";
4
5describe("resolveWebLocaleSelection", () => {
6 it.each([
7 ["system", ["en-GB"], "en", undefined],
8 ["system", ["zh-TW", "en-GB"], "en", undefined],
9 ["en", ["en-GB"], "en", undefined],
10 ["en", ["de-DE"], "en", "en"],
11 ["de", ["en-US"], "de", "de"],
12 ] as const)("%s with browser languages %j", (language, browserLocales, catalog, formatting) => {
13 expect(resolveWebLocaleSelection(language, browserLocales)).toEqual({
14 catalogLocale: catalog,
15 formattingLocale: formatting,
16 });
17 });
18});