mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 10:20:21 +00:00
test(feishu): stabilize bot-menu lifecycle replay
This commit is contained in:
@@ -166,6 +166,7 @@ describe("Feishu bot-menu lifecycle", () => {
|
|||||||
event,
|
event,
|
||||||
dispatchReplyFromConfigMock,
|
dispatchReplyFromConfigMock,
|
||||||
createFeishuReplyDispatcherMock,
|
createFeishuReplyDispatcherMock,
|
||||||
|
waitTimeoutMs: 5_000,
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(lastRuntime?.error).not.toHaveBeenCalled();
|
expect(lastRuntime?.error).not.toHaveBeenCalled();
|
||||||
|
|||||||
@@ -321,17 +321,27 @@ export async function expectFeishuReplyPipelineDedupedAcrossReplay(params: {
|
|||||||
event: unknown;
|
event: unknown;
|
||||||
dispatchReplyFromConfigMock: ReturnType<typeof vi.fn>;
|
dispatchReplyFromConfigMock: ReturnType<typeof vi.fn>;
|
||||||
createFeishuReplyDispatcherMock: ReturnType<typeof vi.fn>;
|
createFeishuReplyDispatcherMock: ReturnType<typeof vi.fn>;
|
||||||
|
waitTimeoutMs?: number;
|
||||||
}) {
|
}) {
|
||||||
|
const waitTimeoutMs = params.waitTimeoutMs;
|
||||||
await replayFeishuLifecycleEvent({
|
await replayFeishuLifecycleEvent({
|
||||||
handler: params.handler,
|
handler: params.handler,
|
||||||
event: params.event,
|
event: params.event,
|
||||||
waitForFirst: () => {
|
waitForFirst: () =>
|
||||||
expect(params.dispatchReplyFromConfigMock).toHaveBeenCalledTimes(1);
|
vi.waitFor(
|
||||||
},
|
() => {
|
||||||
waitForSecond: () => {
|
expect(params.dispatchReplyFromConfigMock).toHaveBeenCalledTimes(1);
|
||||||
expect(params.dispatchReplyFromConfigMock).toHaveBeenCalledTimes(1);
|
},
|
||||||
expect(params.createFeishuReplyDispatcherMock).toHaveBeenCalledTimes(1);
|
waitTimeoutMs == null ? undefined : { timeout: waitTimeoutMs },
|
||||||
},
|
),
|
||||||
|
waitForSecond: () =>
|
||||||
|
vi.waitFor(
|
||||||
|
() => {
|
||||||
|
expect(params.dispatchReplyFromConfigMock).toHaveBeenCalledTimes(1);
|
||||||
|
expect(params.createFeishuReplyDispatcherMock).toHaveBeenCalledTimes(1);
|
||||||
|
},
|
||||||
|
waitTimeoutMs == null ? undefined : { timeout: waitTimeoutMs },
|
||||||
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user