mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 13:22:14 +00:00
test(discord): remove monitor polling overhead
This commit is contained in:
@@ -85,16 +85,6 @@ vi.mock("openclaw/plugin-sdk/reply-runtime", async (importOriginal) => {
|
||||
};
|
||||
});
|
||||
|
||||
// agent-components.ts can bind the core dispatcher via reply-runtime re-exports,
|
||||
// so keep this direct mock to avoid hitting real embedded-agent dispatch in tests.
|
||||
vi.mock("openclaw/plugin-sdk/reply-runtime", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/reply-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
dispatchReplyWithBufferedBlockDispatcher: (...args: unknown[]) => dispatchReplyMock(...args),
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock("openclaw/plugin-sdk/config-runtime", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/config-runtime")>();
|
||||
return {
|
||||
@@ -701,16 +691,14 @@ describe("discord component interactions", () => {
|
||||
|
||||
await button.run(interaction, { cid: "btn_1" } as ComponentData);
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(dispatchPluginInteractiveHandlerMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
ctx: expect.objectContaining({
|
||||
conversationId: "channel:group-dm-1",
|
||||
senderId: "123456789",
|
||||
}),
|
||||
expect(dispatchPluginInteractiveHandlerMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
ctx: expect.objectContaining({
|
||||
conversationId: "channel:group-dm-1",
|
||||
senderId: "123456789",
|
||||
}),
|
||||
);
|
||||
});
|
||||
}),
|
||||
);
|
||||
expect(dispatchReplyMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
2
test/fixtures/test-timings.channels.json
vendored
2
test/fixtures/test-timings.channels.json
vendored
@@ -400,7 +400,7 @@
|
||||
"durationMs": 42
|
||||
},
|
||||
"extensions/discord/src/monitor/monitor.test.ts": {
|
||||
"durationMs": 40
|
||||
"durationMs": 19800
|
||||
},
|
||||
"extensions/discord/src/monitor/provider.lifecycle.test.ts": {
|
||||
"durationMs": 39
|
||||
|
||||
Reference in New Issue
Block a user