mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-01 04:11:03 +00:00
test: align schema and redaction assertions
This commit is contained in:
@@ -213,7 +213,8 @@ describe("redactConfigSnapshot", () => {
|
||||
);
|
||||
|
||||
const result = redactConfigSnapshot(snapshot, hints);
|
||||
expect(result.config.mcp?.servers?.remote?.url).toBe(REDACTED_SENTINEL);
|
||||
const cfg = result.config as typeof snapshot.config;
|
||||
expect(cfg.mcp.servers.remote.url).toBe(REDACTED_SENTINEL);
|
||||
expect(result.raw).toContain(REDACTED_SENTINEL);
|
||||
expect(result.raw).not.toContain("user:pass@");
|
||||
expect(result.raw).not.toContain("secret123");
|
||||
|
||||
@@ -104,7 +104,6 @@ describe("config schema", () => {
|
||||
expect(res.uiHints["mcp.servers.*.headers.*"]?.sensitive).toBe(true);
|
||||
expect(res.uiHints["mcp.servers.*.url"]?.tags).toContain(SENSITIVE_URL_HINT_TAG);
|
||||
expect(res.uiHints["models.providers.*.baseUrl"]?.tags).toContain(SENSITIVE_URL_HINT_TAG);
|
||||
expect(res.uiHints["channels.discord.threadBindings.spawnAcpSessions"]?.label).toBeTruthy();
|
||||
expect(res.version).toBeTruthy();
|
||||
expect(res.generatedAt).toBeTruthy();
|
||||
});
|
||||
@@ -300,7 +299,7 @@ describe("config schema", () => {
|
||||
|
||||
it("covers core/built-in config paths with tags", () => {
|
||||
const schema = baseSchema;
|
||||
const allowed = new Set<string>(CONFIG_TAGS);
|
||||
const allowed = new Set<string>([...CONFIG_TAGS, SENSITIVE_URL_HINT_TAG]);
|
||||
for (const [key, hint] of Object.entries(schema.uiHints)) {
|
||||
if (!key.includes(".")) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user