Skip to content

Commit fd79013

Browse files
committed
test: dedupe plugin approval mock reads
1 parent ed3df9c commit fd79013

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/gateway/server-methods/plugin-approval.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ describe("createPluginApprovalHandlers", () => {
356356
},
357357
);
358358
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);
360360
expectPluginApprovalId(result?.id, "generated plugin approval id");
361361
});
362362

@@ -374,7 +374,10 @@ describe("createPluginApprovalHandlers", () => {
374374
await handlers["plugin.approval.request"](opts);
375375

376376
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+
);
378381
});
379382

380383
it("rejects plugin-provided id field", async () => {

0 commit comments

Comments
 (0)