refactor: normalize hook agent providers

This commit is contained in:
Peter Steinberger
2026-01-09 17:40:36 +01:00
parent f146c9ef16
commit 51725a71a3
5 changed files with 53 additions and 36 deletions

View File

@@ -87,6 +87,15 @@ describe("gateway hooks helpers", () => {
expect(imsg.value.provider).toBe("imessage");
}
const teams = normalizeAgentPayload(
{ message: "yo", provider: "teams" },
{ idFactory: () => "x" },
);
expect(teams.ok).toBe(true);
if (teams.ok) {
expect(teams.value.provider).toBe("msteams");
}
const bad = normalizeAgentPayload({ message: "yo", provider: "sms" });
expect(bad.ok).toBe(false);
});