@@ -12,6 +12,14 @@ vi.mock("../plugins/tools.js", () => ({
|
12 | 12 | resolvePluginTools: (...args: unknown[]) => hoisted.resolvePluginTools(...args), |
13 | 13 | })); |
14 | 14 | |
| 15 | +function firstResolvePluginToolsParams(): Record<string, unknown> { |
| 16 | +const call = hoisted.resolvePluginTools.mock.calls[0]; |
| 17 | +if (!call) { |
| 18 | +throw new Error("Expected plugin tool resolution"); |
| 19 | +} |
| 20 | +return call[0] as Record<string, unknown>; |
| 21 | +} |
| 22 | + |
15 | 23 | describe("createOpenClawTools browser plugin integration", () => { |
16 | 24 | afterEach(() => { |
17 | 25 | hoisted.resolvePluginTools.mockReset(); |
@@ -135,9 +143,7 @@ describe("createOpenClawTools browser plugin integration", () => {
|
135 | 143 | }); |
136 | 144 | |
137 | 145 | expect(hoisted.resolvePluginTools).toHaveBeenCalledTimes(1); |
138 | | -expect(hoisted.resolvePluginTools.mock.calls.at(0)?.[0]?.allowGatewaySubagentBinding).toBe( |
139 | | -true, |
140 | | -); |
| 146 | +expect(firstResolvePluginToolsParams().allowGatewaySubagentBinding).toBe(true); |
141 | 147 | }); |
142 | 148 | |
143 | 149 | it("forwards auth profile helpers to plugin resolution and context", async () => { |
@@ -212,8 +218,9 @@ describe("createOpenClawTools browser plugin integration", () => {
|
212 | 218 | }); |
213 | 219 | |
214 | 220 | expect(hoisted.resolvePluginTools).toHaveBeenCalledTimes(1); |
215 | | -expect(hoisted.resolvePluginTools.mock.calls.at(0)?.[0]?.toolAllowlist).toEqual(["*"]); |
216 | | -expect(hoisted.resolvePluginTools.mock.calls.at(0)?.[0]?.toolDenylist).toEqual(["browser"]); |
| 221 | +const params = firstResolvePluginToolsParams(); |
| 222 | +expect(params.toolAllowlist).toEqual(["*"]); |
| 223 | +expect(params.toolDenylist).toEqual(["browser"]); |
217 | 224 | }); |
218 | 225 | |
219 | 226 | it("does not pass a stale active snapshot as plugin runtime config for a resolved run config", () => { |
|