mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 20:48:26 +00:00
chore: Fix types in tests 22/N.
This commit is contained in:
@@ -56,8 +56,8 @@ function buildDispatchContextPayload(params: { cfg: OpenClawConfig; message: IMe
|
||||
accountId: "default",
|
||||
message,
|
||||
opts: {},
|
||||
messageText: message.text,
|
||||
bodyText: message.text,
|
||||
messageText: message.text ?? "",
|
||||
bodyText: message.text ?? "",
|
||||
allowFrom: ["*"],
|
||||
groupAllowFrom: [],
|
||||
groupPolicy: "open",
|
||||
@@ -67,6 +67,9 @@ function buildDispatchContextPayload(params: { cfg: OpenClawConfig; message: IMe
|
||||
groupHistories,
|
||||
});
|
||||
expect(decision.kind).toBe("dispatch");
|
||||
if (decision.kind !== "dispatch") {
|
||||
throw new Error("expected dispatch decision");
|
||||
}
|
||||
|
||||
const { ctxPayload } = buildIMessageInboundContext({
|
||||
cfg,
|
||||
@@ -169,8 +172,8 @@ describe("imessage monitor gating + envelope builders", () => {
|
||||
accountId: "default",
|
||||
message,
|
||||
opts: {},
|
||||
messageText: message.text,
|
||||
bodyText: message.text,
|
||||
messageText: message.text ?? "",
|
||||
bodyText: message.text ?? "",
|
||||
allowFrom: ["*"],
|
||||
groupAllowFrom: [],
|
||||
groupPolicy: "open",
|
||||
@@ -180,6 +183,9 @@ describe("imessage monitor gating + envelope builders", () => {
|
||||
groupHistories,
|
||||
});
|
||||
expect(decision.kind).toBe("dispatch");
|
||||
if (decision.kind !== "dispatch") {
|
||||
throw new Error("expected dispatch decision");
|
||||
}
|
||||
expect(decision.isGroup).toBe(true);
|
||||
expect(decision.route.sessionKey).toBe("agent:main:imessage:group:2");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user