|
|
|
|
@ -15,7 +15,7 @@ describe("Telegram webhookPort config", () => {
|
|
|
|
|
expect(res.ok).toBe(true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("rejects non-positive webhookPort", () => {
|
|
|
|
|
it("accepts webhookPort set to 0 for ephemeral port binding", () => {
|
|
|
|
|
const res = validateConfigObject({
|
|
|
|
|
channels: {
|
|
|
|
|
telegram: {
|
|
|
|
|
@ -25,6 +25,19 @@ describe("Telegram webhookPort config", () => {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
expect(res.ok).toBe(true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("rejects negative webhookPort", () => {
|
|
|
|
|
const res = validateConfigObject({
|
|
|
|
|
channels: {
|
|
|
|
|
telegram: {
|
|
|
|
|
webhookUrl: "https://example.com/telegram-webhook",
|
|
|
|
|
webhookSecret: "secret",
|
|
|
|
|
webhookPort: -1,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
expect(res.ok).toBe(false);
|
|
|
|
|
if (!res.ok) {
|
|
|
|
|
expect(res.issues.some((issue) => issue.path === "channels.telegram.webhookPort")).toBe(true);
|
|
|
|
|
|