fix(routing): preserve explicit cron account and bound message defaults

Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com>
Co-authored-by: stakeswky <64798754+stakeswky@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-02-26 02:43:22 +00:00
parent 92eb3dfc9d
commit 1e7ec8bfd2
10 changed files with 114 additions and 1 deletions

View File

@@ -54,4 +54,22 @@ describe("resolveCronDeliveryPlan", () => {
expect(plan.channel).toBeUndefined();
expect(plan.to).toBe("https://example.invalid/cron");
});
it("threads delivery.accountId when explicitly configured", () => {
const plan = resolveCronDeliveryPlan(
makeJob({
delivery: {
mode: "announce",
channel: "telegram",
to: "123",
accountId: " bot-a ",
},
}),
);
expect(plan.mode).toBe("announce");
expect(plan.requested).toBe(true);
expect(plan.channel).toBe("telegram");
expect(plan.to).toBe("123");
expect(plan.accountId).toBe("bot-a");
});
});