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