mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 20:28:29 +00:00
refactor: normalize hook agent providers
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user