返回 DeepSeek-Reasonix
bot-connection-settings.test.ts
根目录 / desktop / frontend / src / __tests__ / bot-connection-settings.test.ts
1 import { botConnectionLabel } from "../components/botConnectionSettings";
2 import type { useT } from "../lib/i18n";
3 import type { BotConnectionView } from "../lib/types";
4
5 const t = ((key: string) => key === "settings.botDingtalk" ? "DingTalk" : key) as ReturnType<typeof useT>;
6 const connection = {
7 provider: "dingtalk",
8 domain: "dingtalk",
9 } as BotConnectionView;
10
11 const label = botConnectionLabel(connection, t);
12 if (label !== "DingTalk") {
13 throw new Error(`DingTalk connection label = ${JSON.stringify(label)}, want \"DingTalk\"`);
14 }
15
16 console.log("bot connection settings: DingTalk label passed");
17
17 lines TYPESCRIPT