























@@ -349,6 +349,18 @@ function firstMockCall(mock: { mock: { calls: unknown[][] } }, label: string): u
349349return call;
350350}
351351352+function latestMockCall(mock: { mock: { calls: unknown[][] } }, label: string): unknown[] {
353+const call = mock.mock.calls[mock.mock.calls.length - 1];
354+if (!call) {
355+throw new Error(`Expected ${label} to be called`);
356+}
357+return call;
358+}
359+360+function latestBindingInput(): Record<string, unknown> {
361+return expectRecordFields(latestMockCall(hoisted.sessionBindingBindMock, "session bind")[0], {});
362+}
363+352364function gatewayRequests(): Array<{ method?: string; params?: Record<string, unknown> }> {
353365return hoisted.callGatewayMock.mock.calls.map(
354366(call: unknown[]) => call[0] as { method?: string; params?: Record<string, unknown> },
@@ -384,7 +396,7 @@ function expectBindingCallFields(expected: {
384396placement?: string;
385397targetKind?: string;
386398}): Record<string, unknown> {
387-const input = expectRecordFields(hoisted.sessionBindingBindMock.mock.calls.at(-1)?.[0], {
399+const input = expectRecordFields(latestBindingInput(), {
388400 ...(expected.placement ? { placement: expected.placement } : {}),
389401 ...(expected.targetKind ? { targetKind: expected.targetKind } : {}),
390402});
@@ -2644,10 +2656,9 @@ describe("spawnAcpDirect", () => {
26442656conversationId: "6098642967",
26452657},
26462658});
2647-const bindCall = hoisted.sessionBindingBindMock.mock.calls.at(-1)?.[0] as
2648-| { conversation?: { parentConversationId?: string } }
2649-| undefined;
2650-expect(bindCall?.conversation?.parentConversationId).toBeUndefined();
2659+const bindCall = latestBindingInput();
2660+const conversation = expectRecordFields(bindCall.conversation, {});
2661+expect(conversation.parentConversationId).toBeUndefined();
26512662});
2652266326532664it("preserves topic-qualified Telegram targets without a separate threadId", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。