mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
test: narrow web provider artifact invariants
This commit is contained in:
@@ -15,9 +15,9 @@ vi.mock("./manifest-registry.js", async (importOriginal) => {
|
||||
});
|
||||
|
||||
import {
|
||||
resolveBundledExplicitWebFetchProvidersFromPublicArtifacts,
|
||||
resolveBundledExplicitWebSearchProvidersFromPublicArtifacts,
|
||||
} from "./web-provider-public-artifacts.explicit.js";
|
||||
resolveBundledWebFetchProvidersFromPublicArtifacts,
|
||||
resolveBundledWebSearchProvidersFromPublicArtifacts,
|
||||
} from "./web-provider-public-artifacts.js";
|
||||
|
||||
describe("web provider public artifacts explicit fast path", () => {
|
||||
beforeEach(() => {
|
||||
@@ -25,7 +25,8 @@ describe("web provider public artifacts explicit fast path", () => {
|
||||
});
|
||||
|
||||
it("resolves bundled web search providers by explicit plugin id without manifest scans", () => {
|
||||
const provider = resolveBundledExplicitWebSearchProvidersFromPublicArtifacts({
|
||||
const provider = resolveBundledWebSearchProvidersFromPublicArtifacts({
|
||||
bundledAllowlistCompat: true,
|
||||
onlyPluginIds: ["brave"],
|
||||
})?.[0];
|
||||
|
||||
@@ -35,7 +36,8 @@ describe("web provider public artifacts explicit fast path", () => {
|
||||
});
|
||||
|
||||
it("resolves bundled web fetch providers by explicit plugin id without manifest scans", () => {
|
||||
const provider = resolveBundledExplicitWebFetchProvidersFromPublicArtifacts({
|
||||
const provider = resolveBundledWebFetchProvidersFromPublicArtifacts({
|
||||
bundledAllowlistCompat: true,
|
||||
onlyPluginIds: ["firecrawl"],
|
||||
})?.[0];
|
||||
|
||||
|
||||
@@ -4,10 +4,6 @@ import {
|
||||
hasBundledWebFetchProviderPublicArtifact,
|
||||
hasBundledWebSearchProviderPublicArtifact,
|
||||
} from "./web-provider-public-artifacts.explicit.js";
|
||||
import {
|
||||
resolveBundledWebFetchProvidersFromPublicArtifacts,
|
||||
resolveBundledWebSearchProvidersFromPublicArtifacts,
|
||||
} from "./web-provider-public-artifacts.js";
|
||||
|
||||
describe("web provider public artifacts", () => {
|
||||
it("has a public artifact for every bundled web search provider declared in manifests", () => {
|
||||
@@ -33,24 +29,4 @@ describe("web provider public artifacts", () => {
|
||||
expect(hasBundledWebFetchProviderPublicArtifact(pluginId)).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it("loads a lightweight bundled web search artifact smoke", () => {
|
||||
const provider = resolveBundledWebSearchProvidersFromPublicArtifacts({
|
||||
bundledAllowlistCompat: true,
|
||||
onlyPluginIds: ["brave"],
|
||||
})?.[0];
|
||||
|
||||
expect(provider?.pluginId).toBe("brave");
|
||||
expect(provider?.createTool({ config: {} as never })).toBeNull();
|
||||
});
|
||||
|
||||
it("prefers lightweight bundled web fetch contract artifacts", () => {
|
||||
const provider = resolveBundledWebFetchProvidersFromPublicArtifacts({
|
||||
bundledAllowlistCompat: true,
|
||||
onlyPluginIds: ["firecrawl"],
|
||||
})?.[0];
|
||||
|
||||
expect(provider?.pluginId).toBe("firecrawl");
|
||||
expect(provider?.createTool({ config: {} as never })).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user