test: align schema and redaction assertions

This commit is contained in:
Peter Steinberger
2026-03-29 21:27:20 +01:00
parent b4badd7704
commit 356adc98d5
2 changed files with 3 additions and 3 deletions

View File

@@ -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");

View File

@@ -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;