mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-25 08:52:12 +00:00
20 lines
721 B
TypeScript
20 lines
721 B
TypeScript
import { API_CONSTANTS } from "grammy";
|
|
import { describe, expect, it } from "vitest";
|
|
import { DEFAULT_TELEGRAM_UPDATE_TYPES, resolveTelegramAllowedUpdates } from "./allowed-updates.js";
|
|
|
|
describe("resolveTelegramAllowedUpdates", () => {
|
|
it("includes the default update types plus reaction and channel post support", () => {
|
|
const updates = resolveTelegramAllowedUpdates();
|
|
|
|
expect(updates).toEqual(
|
|
expect.arrayContaining([
|
|
...DEFAULT_TELEGRAM_UPDATE_TYPES,
|
|
...(API_CONSTANTS?.DEFAULT_UPDATE_TYPES ?? []),
|
|
]),
|
|
);
|
|
expect(updates).toContain("message_reaction");
|
|
expect(updates).toContain("channel_post");
|
|
expect(new Set(updates).size).toBe(updates.length);
|
|
});
|
|
});
|