mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-13 11:00:50 +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(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