@@ -95,12 +95,10 @@ describe("web_fetch provider fallback normalization", () => {
|
95 | 95 | expect(details.title).toContain("Provider Title"); |
96 | 96 | expect(details.warning).toContain("Provider Warning"); |
97 | 97 | expect(details.truncated).toBe(true); |
98 | | -expect(details.externalContent).toMatchObject({ |
99 | | -untrusted: true, |
100 | | -source: "web_fetch", |
101 | | -wrapped: true, |
102 | | -provider: "firecrawl", |
103 | | -}); |
| 98 | +expect(details.externalContent?.untrusted).toBe(true); |
| 99 | +expect(details.externalContent?.source).toBe("web_fetch"); |
| 100 | +expect(details.externalContent?.wrapped).toBe(true); |
| 101 | +expect(details.externalContent?.provider).toBe("firecrawl"); |
104 | 102 | }); |
105 | 103 | |
106 | 104 | it("keeps requested url and only accepts safe provider finalUrl values", async () => { |
@@ -209,17 +207,15 @@ describe("web_fetch provider fallback normalization", () => {
|
209 | 207 | |
210 | 208 | expect(details.wrappedLength).toBeGreaterThan(200); |
211 | 209 | expect(details.wrappedLength).toBeLessThanOrEqual(640); |
212 | | -expect(details.externalContent).toMatchObject({ |
213 | | -provider: "firecrawl", |
214 | | -}); |
215 | | -expect(resolveWebFetchDefinitionMock).toHaveBeenCalledWith( |
216 | | -expect.objectContaining({ |
217 | | -config: runtimeConfig, |
218 | | -runtimeWebFetch: expect.objectContaining({ |
219 | | -selectedProvider: "firecrawl", |
220 | | -}), |
221 | | -}), |
222 | | -); |
| 210 | +expect(details.externalContent?.provider).toBe("firecrawl"); |
| 211 | +const definitionInput = resolveWebFetchDefinitionMock.mock.calls[0]?.[0] as |
| 212 | +| { |
| 213 | +config?: OpenClawConfig; |
| 214 | +runtimeWebFetch?: { selectedProvider?: string }; |
| 215 | +} |
| 216 | +| undefined; |
| 217 | +expect(definitionInput?.config).toBe(runtimeConfig); |
| 218 | +expect(definitionInput?.runtimeWebFetch?.selectedProvider).toBe("firecrawl"); |
223 | 219 | }); |
224 | 220 | |
225 | 221 | it("scopes provider fallback cache entries by the late-bound provider", async () => { |
|