test: assert exact redaction sentinel in skills.update response test

Use __OPENCLAW_REDACTED__ sentinel value instead of .not.toBe() to
properly verify the redaction contract — weak negation checks would
pass even if the field were silently dropped or set to null.
This commit is contained in:
Ziy1-Tan
2026-04-22 13:56:57 +08:00
committed by Mason Huang
parent 3cf89613f1
commit 7e3084f405

View File

@@ -90,9 +90,9 @@ describe("skills.update", () => {
// Response must not expose plaintext secrets
const config = (responseResult as { config: Record<string, unknown> }).config;
expect(config.apiKey).not.toBe("secret-api-key-123");
expect(config.apiKey).toBe("__OPENCLAW_REDACTED__");
const env = config.env as Record<string, string>;
expect(env.GEMINI_API_KEY).not.toBe("secret-env-key-456");
expect(env.GEMINI_API_KEY).toBe("__OPENCLAW_REDACTED__");
// Non-secret env values should still be present
expect(env.BRAVE_REGION).toBe("us");
});