fix(cli): route telegram thread create to topic-create

This commit is contained in:
Andy
2026-03-25 15:36:35 +08:00
committed by Ayaan Zaidi
parent 4140100807
commit e1cd90db6e
2 changed files with 22 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
import { describe, expect, it } from "vitest";
import { __test__ } from "./register.thread.js";
describe("resolveThreadCreateAction", () => {
it("maps telegram thread create to topic-create", () => {
expect(__test__.resolveThreadCreateAction({ channel: "telegram" })).toBe("topic-create");
expect(__test__.resolveThreadCreateAction({ channel: " Telegram " })).toBe("topic-create");
});
it("keeps thread-create for non-telegram channels", () => {
expect(__test__.resolveThreadCreateAction({ channel: "discord" })).toBe("thread-create");
expect(__test__.resolveThreadCreateAction({ channel: undefined })).toBe("thread-create");
});
});