mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 09:28:37 +00:00
test(discord): use mock clears in monitor setup defaults
This commit is contained in:
@@ -119,9 +119,9 @@ describe("agent components", () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
readAllowFromStoreMock.mockReset().mockResolvedValue([]);
|
readAllowFromStoreMock.mockClear().mockResolvedValue([]);
|
||||||
upsertPairingRequestMock.mockReset().mockResolvedValue({ code: "PAIRCODE", created: true });
|
upsertPairingRequestMock.mockClear().mockResolvedValue({ code: "PAIRCODE", created: true });
|
||||||
enqueueSystemEventMock.mockReset();
|
enqueueSystemEventMock.mockClear();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("sends pairing reply when DM sender is not allowlisted", async () => {
|
it("sends pairing reply when DM sender is not allowlisted", async () => {
|
||||||
@@ -282,17 +282,17 @@ describe("discord component interactions", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
clearDiscordComponentEntries();
|
clearDiscordComponentEntries();
|
||||||
lastDispatchCtx = undefined;
|
lastDispatchCtx = undefined;
|
||||||
readAllowFromStoreMock.mockReset().mockResolvedValue([]);
|
readAllowFromStoreMock.mockClear().mockResolvedValue([]);
|
||||||
upsertPairingRequestMock.mockReset().mockResolvedValue({ code: "PAIRCODE", created: true });
|
upsertPairingRequestMock.mockClear().mockResolvedValue({ code: "PAIRCODE", created: true });
|
||||||
enqueueSystemEventMock.mockReset();
|
enqueueSystemEventMock.mockClear();
|
||||||
dispatchReplyMock.mockReset().mockImplementation(async (params: DispatchParams) => {
|
dispatchReplyMock.mockClear().mockImplementation(async (params: DispatchParams) => {
|
||||||
lastDispatchCtx = params.ctx;
|
lastDispatchCtx = params.ctx;
|
||||||
await params.dispatcherOptions.deliver({ text: "ok" });
|
await params.dispatcherOptions.deliver({ text: "ok" });
|
||||||
});
|
});
|
||||||
deliverDiscordReplyMock.mockReset();
|
deliverDiscordReplyMock.mockClear();
|
||||||
recordInboundSessionMock.mockReset().mockResolvedValue(undefined);
|
recordInboundSessionMock.mockClear().mockResolvedValue(undefined);
|
||||||
readSessionUpdatedAtMock.mockReset().mockReturnValue(undefined);
|
readSessionUpdatedAtMock.mockClear().mockReturnValue(undefined);
|
||||||
resolveStorePathMock.mockReset().mockReturnValue("/tmp/openclaw-sessions-test.json");
|
resolveStorePathMock.mockClear().mockReturnValue("/tmp/openclaw-sessions-test.json");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("routes button clicks with reply references", async () => {
|
it("routes button clicks with reply references", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user