refactor: cron payload migration cleanup (#621)
* refactor: centralize cron payload migration * test: stabilize block streaming mocks * test: adjust chunker fence-close case
This commit is contained in:
committed by
GitHub
parent
e3c340fd38
commit
98d0318d4e
@@ -14,7 +14,7 @@ describe("normalizeCronJobCreate", () => {
|
||||
kind: "agentTurn",
|
||||
message: "hi",
|
||||
deliver: true,
|
||||
channel: "telegram",
|
||||
channel: " TeLeGrAm ",
|
||||
to: "7200373102",
|
||||
},
|
||||
}) as unknown as Record<string, unknown>;
|
||||
@@ -23,4 +23,24 @@ describe("normalizeCronJobCreate", () => {
|
||||
expect(payload.provider).toBe("telegram");
|
||||
expect("channel" in payload).toBe(false);
|
||||
});
|
||||
|
||||
it("canonicalizes payload.provider casing", () => {
|
||||
const normalized = normalizeCronJobCreate({
|
||||
name: "legacy provider",
|
||||
enabled: true,
|
||||
schedule: { kind: "cron", expr: "* * * * *" },
|
||||
sessionTarget: "isolated",
|
||||
wakeMode: "now",
|
||||
payload: {
|
||||
kind: "agentTurn",
|
||||
message: "hi",
|
||||
deliver: true,
|
||||
provider: "Telegram",
|
||||
to: "7200373102",
|
||||
},
|
||||
}) as unknown as Record<string, unknown>;
|
||||
|
||||
const payload = normalized.payload as Record<string, unknown>;
|
||||
expect(payload.provider).toBe("telegram");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user