mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 18:54:58 +00:00
fix(slack): correct typed message event overloads (#31701)
This commit is contained in:
@@ -192,4 +192,26 @@ describe("registerSlackMessageEvents", () => {
|
|||||||
expect(handleSlackMessage).toHaveBeenCalledTimes(2);
|
expect(handleSlackMessage).toHaveBeenCalledTimes(2);
|
||||||
expect(messageQueueMock).not.toHaveBeenCalled();
|
expect(messageQueueMock).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("applies subtype system-event handling for message.channels events", async () => {
|
||||||
|
messageQueueMock.mockClear();
|
||||||
|
messageAllowMock.mockReset().mockResolvedValue([]);
|
||||||
|
const { channelHandler, handleSlackMessage } = createMessageHandlers({
|
||||||
|
dmPolicy: "open",
|
||||||
|
channelType: "channel",
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(channelHandler).toBeTruthy();
|
||||||
|
|
||||||
|
await channelHandler!({
|
||||||
|
event: {
|
||||||
|
...makeChangedEvent({ channel: "C1", user: "U1" }),
|
||||||
|
channel_type: "channel",
|
||||||
|
},
|
||||||
|
body: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(handleSlackMessage).not.toHaveBeenCalled();
|
||||||
|
expect(messageQueueMock).toHaveBeenCalledTimes(1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user