feat: fix Telegram controls and add GitHub links

This commit is contained in:
zhoujun0601
2026-08-13 12:20:30 -04:00
parent a027edda88
commit 5c8a3ffb8f
14 changed files with 477 additions and 16 deletions
+22 -1
View File
@@ -1,6 +1,12 @@
import { describe, expect, it } from "vitest";
import { ApiError, toErrorMessage } from "./api";
import { decodeDashboard, decodeDeviceLogin, decodeGeneral } from "./types";
import {
decodeAction,
decodeDashboard,
decodeDeviceLogin,
decodeGeneral,
decodeTelegram,
} from "./types";
describe("API decoders", () => {
it("保留 Dashboard 的 null 与 optional 摘要", () => {
@@ -46,6 +52,21 @@ describe("API decoders", () => {
}).userCode,
).toBe("ABC");
});
it("保留 Telegram 操作警告", () => {
expect(
decodeTelegram({
chatId: 1,
enabled: false,
menuEnabled: false,
configured: true,
warning: "菜单同步失败",
}).warning,
).toBe("菜单同步失败");
expect(decodeAction({ ok: true, warning: "键盘清理失败" }).warning).toBe(
"键盘清理失败",
);
});
});
describe("errors", () => {