mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 18:04:59 +00:00
refactor(channels): dedupe transport and gateway test scaffolds
This commit is contained in:
35
src/signal/monitor/event-handler.test-harness.ts
Normal file
35
src/signal/monitor/event-handler.test-harness.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { SignalEventHandlerDeps, SignalReactionMessage } from "./event-handler.types.js";
|
||||
|
||||
export function createBaseSignalEventHandlerDeps(
|
||||
overrides: Partial<SignalEventHandlerDeps> = {},
|
||||
): SignalEventHandlerDeps {
|
||||
return {
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
runtime: { log: () => {}, error: () => {} } as any,
|
||||
cfg: {},
|
||||
baseUrl: "http://localhost",
|
||||
accountId: "default",
|
||||
historyLimit: 5,
|
||||
groupHistories: new Map(),
|
||||
textLimit: 4000,
|
||||
dmPolicy: "open",
|
||||
allowFrom: ["*"],
|
||||
groupAllowFrom: ["*"],
|
||||
groupPolicy: "open",
|
||||
reactionMode: "off",
|
||||
reactionAllowlist: [],
|
||||
mediaMaxBytes: 1024,
|
||||
ignoreAttachments: true,
|
||||
sendReadReceipts: false,
|
||||
readReceiptsViaDaemon: false,
|
||||
fetchAttachment: async () => null,
|
||||
deliverReplies: async () => {},
|
||||
resolveSignalReactionTargets: () => [],
|
||||
isSignalReactionMessage: (
|
||||
_reaction: SignalReactionMessage | null | undefined,
|
||||
): _reaction is SignalReactionMessage => false,
|
||||
shouldEmitSignalReactionNotification: () => false,
|
||||
buildSignalReactionSystemEventText: () => "reaction",
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user