diff --git a/__test__/resource.test.ts b/__test__/resource.test.ts index ec5bff0b..5fd970ce 100644 --- a/__test__/resource.test.ts +++ b/__test__/resource.test.ts @@ -1,6 +1,14 @@ import * as res from "../src/options/logic/resource"; test("", () => { + expect(res.decideInitialLanguage([])).toEqual("en"); + expect(res.decideInitialLanguage(["en", "ja"])).toEqual("en"); + expect(res.decideInitialLanguage(["ja", "en"])).toEqual("ja"); + expect(res.decideInitialLanguage(["fr", "ja", "en"])).toEqual("ja"); + expect(res.decideInitialLanguage(["en-US", "ja"])).toEqual("en"); + expect(res.decideInitialLanguage(["en-UK", "ja"])).toEqual("en"); + expect(res.decideInitialLanguage(["ja-JP", "en"])).toEqual("ja"); + res.setLang("ja"); expect(res.get("selectDictFile")).toEqual("辞書ファイルを選択してください。"); expect(res.get("finishRegister", { count: 999 })).toEqual("登録完了(999語)");