test: tighten voice call hangup assertion · openclaw/openclaw@80f3c0a
steipete
·
2026-05-10
·
via Recent Commits to openclaw:main
File tree
extensions/voice-call/src
| Original file line number | Diff line number | Diff line change |
|---|
@@ -75,12 +75,12 @@ function expectSingleRejectedReplayHangup(params: {
|
75 | 75 | expect(params.first.status).toBe(200); |
76 | 76 | expect(params.second.status).toBe(200); |
77 | 77 | expect(params.provider.hangupCalls).toHaveLength(1); |
78 | | -expect(params.provider.hangupCalls[0]).toEqual( |
79 | | - expect.objectContaining({ |
80 | | - providerCallId: "provider-inbound-1", |
81 | | - reason: "hangup-bot", |
82 | | - }), |
83 | | -); |
| 78 | +const [hangupCall] = params.provider.hangupCalls; |
| 79 | +if (!hangupCall) { |
| 80 | +throw new Error("Expected rejected replay hangup call"); |
| 81 | +} |
| 82 | +expect(hangupCall.providerCallId).toBe("provider-inbound-1"); |
| 83 | +expect(hangupCall.reason).toBe("hangup-bot"); |
84 | 84 | expect(params.manager.getCallByProviderCallId("provider-inbound-1")).toBeUndefined(); |
85 | 85 | } |
86 | 86 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。