refactor(cron): extract delivery dispatch + harden reset notices

This commit is contained in:
Peter Steinberger
2026-02-23 19:24:58 +00:00
parent fe62711342
commit 7a40d99b1d
3 changed files with 481 additions and 302 deletions

View File

@@ -221,4 +221,32 @@ describe("runPreparedReply media-only handling", () => {
expect(resetNoticeCall?.payload?.text).not.toContain("api-key");
expect(resetNoticeCall?.payload?.text).not.toContain("env:");
});
it("skips reset notice when only webchat fallback routing is available", async () => {
await runPreparedReply(
baseParams({
resetTriggered: true,
ctx: {
Body: "",
RawBody: "",
CommandBody: "",
ThreadHistoryBody: "Earlier message in this thread",
OriginatingChannel: undefined,
OriginatingTo: undefined,
ChatType: "group",
},
command: {
isAuthorizedSender: true,
abortKey: "session-key",
ownerList: [],
senderIsOwner: false,
channel: "webchat",
from: undefined,
to: undefined,
} as never,
}),
);
expect(vi.mocked(routeReply)).not.toHaveBeenCalled();
});
});