mirror of https://github.com/openclaw/openclaw.git
test(feishu): stabilize bot-menu lifecycle replay
This commit is contained in:
parent
c3c1f9df54
commit
0ebd7df9dc
|
|
@ -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 },
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue