test: dedupe plugin approval mock reads · openclaw/openclaw@fd79013
steipete
·
2026-05-13
·
via Recent Commits to openclaw:main
File tree
src/gateway/server-methods
| Original file line number | Diff line number | Diff line change |
|---|
@@ -356,7 +356,7 @@ describe("createPluginApprovalHandlers", () => {
|
356 | 356 | }, |
357 | 357 | ); |
358 | 358 | await handlers["plugin.approval.request"](opts); |
359 | | -const result = respond.mock.calls.at(0)?.[1] as Record<string, unknown> | undefined; |
| 359 | +const result = responseResult(respond as unknown as MockCallSource); |
360 | 360 | expectPluginApprovalId(result?.id, "generated plugin approval id"); |
361 | 361 | }); |
362 | 362 | |
@@ -374,7 +374,10 @@ describe("createPluginApprovalHandlers", () => {
|
374 | 374 | await handlers["plugin.approval.request"](opts); |
375 | 375 | |
376 | 376 | expect(createSpy).toHaveBeenCalledTimes(1); |
377 | | -expectPluginApprovalId(createSpy.mock.calls.at(0)?.[2], "manager.create approval id"); |
| 377 | +expectPluginApprovalId( |
| 378 | +mockCall(createSpy, 0, "manager.create call")[2], |
| 379 | +"manager.create approval id", |
| 380 | +); |
378 | 381 | }); |
379 | 382 | |
380 | 383 | it("rejects plugin-provided id field", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。