mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:10:45 +00:00
test(commands): trim duplicate legacy migration cases
This commit is contained in:
@@ -110,38 +110,6 @@ describe("normalizeCompatibilityConfigValues", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("migrates legacy x_search auth into xai plugin-owned config", () => {
|
||||
const res = normalizeCompatibilityConfigValues({
|
||||
tools: {
|
||||
web: {
|
||||
x_search: {
|
||||
apiKey: "xai-legacy-key",
|
||||
enabled: true,
|
||||
model: "grok-4-1-fast",
|
||||
},
|
||||
} as Record<string, unknown>,
|
||||
},
|
||||
});
|
||||
|
||||
expect((res.config.tools?.web as Record<string, unknown> | undefined)?.x_search).toEqual({
|
||||
enabled: true,
|
||||
model: "grok-4-1-fast",
|
||||
});
|
||||
expect(res.config.plugins?.entries?.xai).toEqual({
|
||||
enabled: true,
|
||||
config: {
|
||||
webSearch: {
|
||||
apiKey: "xai-legacy-key",
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(res.changes).toEqual(
|
||||
expect.arrayContaining([
|
||||
"Moved tools.web.x_search.apiKey → plugins.entries.xai.config.webSearch.apiKey.",
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
it("migrates Discord account dm.policy/dm.allowFrom to dmPolicy/allowFrom aliases", () => {
|
||||
const res = normalizeCompatibilityConfigValues({
|
||||
channels: {
|
||||
@@ -565,42 +533,6 @@ describe("normalizeCompatibilityConfigValues", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("migrates legacy web fetch provider config to plugin-owned config paths", () => {
|
||||
const res = normalizeCompatibilityConfigValues({
|
||||
tools: {
|
||||
web: {
|
||||
fetch: {
|
||||
provider: "firecrawl",
|
||||
timeoutSeconds: 15,
|
||||
firecrawl: {
|
||||
apiKey: "firecrawl-key",
|
||||
baseUrl: "https://api.firecrawl.dev",
|
||||
onlyMainContent: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as OpenClawConfig);
|
||||
|
||||
expect(res.config.tools?.web?.fetch).toEqual({
|
||||
provider: "firecrawl",
|
||||
timeoutSeconds: 15,
|
||||
});
|
||||
expect(res.config.plugins?.entries?.firecrawl).toEqual({
|
||||
enabled: true,
|
||||
config: {
|
||||
webFetch: {
|
||||
apiKey: "firecrawl-key",
|
||||
baseUrl: "https://api.firecrawl.dev",
|
||||
onlyMainContent: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(res.changes).toEqual([
|
||||
"Moved tools.web.fetch.firecrawl → plugins.entries.firecrawl.config.webFetch.",
|
||||
]);
|
||||
});
|
||||
|
||||
it("keeps explicit plugin-owned web fetch config while filling missing legacy fields", () => {
|
||||
const res = normalizeCompatibilityConfigValues({
|
||||
tools: {
|
||||
|
||||
Reference in New Issue
Block a user