mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-27 02:17:51 +00:00
test: tighten cli gateway assertions
This commit is contained in:
@@ -83,16 +83,12 @@ describe("registerMessageThreadCommands", () => {
|
||||
{ from: "user" },
|
||||
);
|
||||
|
||||
expect(runMessageAction).toHaveBeenCalledWith(
|
||||
"topic-create",
|
||||
expect.objectContaining({
|
||||
channel: " topic-chat ",
|
||||
target: "room-1",
|
||||
name: "Build Updates",
|
||||
message: "hello",
|
||||
}),
|
||||
);
|
||||
const remappedCall = runMessageAction.mock.calls.at(0);
|
||||
expect(remappedCall?.[0]).toBe("topic-create");
|
||||
expect(remappedCall?.[1]?.channel).toBe(" topic-chat ");
|
||||
expect(remappedCall?.[1]?.target).toBe("room-1");
|
||||
expect(remappedCall?.[1]?.name).toBe("Build Updates");
|
||||
expect(remappedCall?.[1]?.message).toBe("hello");
|
||||
expect(remappedCall?.[1]).not.toHaveProperty("threadName");
|
||||
});
|
||||
|
||||
@@ -116,16 +112,12 @@ describe("registerMessageThreadCommands", () => {
|
||||
{ from: "user" },
|
||||
);
|
||||
|
||||
expect(runMessageAction).toHaveBeenCalledWith(
|
||||
"thread-create",
|
||||
expect.objectContaining({
|
||||
channel: "plain-chat",
|
||||
target: "channel:123",
|
||||
threadName: "Build Updates",
|
||||
message: "hello",
|
||||
}),
|
||||
);
|
||||
const defaultCall = runMessageAction.mock.calls.at(0);
|
||||
expect(defaultCall?.[0]).toBe("thread-create");
|
||||
expect(defaultCall?.[1]?.channel).toBe("plain-chat");
|
||||
expect(defaultCall?.[1]?.target).toBe("channel:123");
|
||||
expect(defaultCall?.[1]?.threadName).toBe("Build Updates");
|
||||
expect(defaultCall?.[1]?.message).toBe("hello");
|
||||
expect(defaultCall?.[1]).not.toHaveProperty("name");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user