mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-22 03:51:18 +00:00
test: tighten web search provider assertions
This commit is contained in:
parent
45f3ec2ead
commit
b7bdcaeb88
2 changed files with 18 additions and 3 deletions
|
|
@ -46,7 +46,12 @@ describe("duckduckgo web search provider", () => {
|
|||
]);
|
||||
expect(provider.requiresCredential).toBe(false);
|
||||
expect(provider.credentialPath).toBe("");
|
||||
expect(applied.plugins?.entries?.duckduckgo?.enabled).toBe(true);
|
||||
const pluginEntry = applied.plugins?.entries?.duckduckgo;
|
||||
expect(pluginEntry).toBeDefined();
|
||||
if (!pluginEntry) {
|
||||
throw new Error("expected DuckDuckGo plugin entry");
|
||||
}
|
||||
expect(pluginEntry.enabled).toBe(true);
|
||||
});
|
||||
|
||||
it("maps generic tool arguments into DuckDuckGo search params", async () => {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,12 @@ describe("exa web search provider", () => {
|
|||
expect(provider.id).toBe("exa");
|
||||
expect(provider.onboardingScopes).toEqual(["text-inference"]);
|
||||
expect(provider.credentialPath).toBe("plugins.entries.exa.config.webSearch.apiKey");
|
||||
expect(applied.plugins?.entries?.exa?.enabled).toBe(true);
|
||||
const pluginEntry = applied.plugins?.entries?.exa;
|
||||
expect(pluginEntry).toBeDefined();
|
||||
if (!pluginEntry) {
|
||||
throw new Error("expected Exa plugin entry");
|
||||
}
|
||||
expect(pluginEntry.enabled).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps the lightweight contract surface aligned with provider metadata", () => {
|
||||
|
|
@ -39,7 +44,12 @@ describe("exa web search provider", () => {
|
|||
credentialPath: provider.credentialPath,
|
||||
});
|
||||
expect(contractProvider.createTool({ config: {}, searchConfig: {} })).toBeNull();
|
||||
expect(applied.plugins?.entries?.exa?.enabled).toBe(true);
|
||||
const pluginEntry = applied.plugins?.entries?.exa;
|
||||
expect(pluginEntry).toBeDefined();
|
||||
if (!pluginEntry) {
|
||||
throw new Error("expected contract Exa plugin entry");
|
||||
}
|
||||
expect(pluginEntry.enabled).toBe(true);
|
||||
});
|
||||
|
||||
it("prefers scoped configured api keys over environment fallbacks", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue