mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 01:04:32 +00:00
Telegram: improve webhook config guidance and startup fallback
This commit is contained in:
@@ -207,6 +207,7 @@ describe("startTelegramWebhook", () => {
|
||||
initSpy.mockClear();
|
||||
createTelegramBotSpy.mockClear();
|
||||
webhookCallbackSpy.mockClear();
|
||||
const runtimeLog = vi.fn();
|
||||
const abort = new AbortController();
|
||||
const cfg = { bindings: [] };
|
||||
const { server } = await startTelegramWebhook({
|
||||
@@ -216,6 +217,7 @@ describe("startTelegramWebhook", () => {
|
||||
config: cfg,
|
||||
port: 0, // random free port
|
||||
abortSignal: abort.signal,
|
||||
runtime: { log: runtimeLog, error: vi.fn(), exit: vi.fn() },
|
||||
});
|
||||
expect(createTelegramBotSpy).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
@@ -246,6 +248,13 @@ describe("startTelegramWebhook", () => {
|
||||
timeoutMilliseconds: 10_000,
|
||||
},
|
||||
);
|
||||
expect(runtimeLog).toHaveBeenCalledWith(
|
||||
expect.stringContaining("webhook local listener on http://127.0.0.1:"),
|
||||
);
|
||||
expect(runtimeLog).toHaveBeenCalledWith(expect.stringContaining("/telegram-webhook"));
|
||||
expect(runtimeLog).toHaveBeenCalledWith(
|
||||
expect.stringContaining("webhook advertised to telegram on http://"),
|
||||
);
|
||||
|
||||
abort.abort();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user