mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 11:11:23 +00:00
test (agents): cover billing mentions in user-facing text sanitizer
This commit is contained in:
@@ -53,6 +53,12 @@ describe("sanitizeUserFacingText", () => {
|
|||||||
expect(sanitizeUserFacingText(text)).toBe(text);
|
expect(sanitizeUserFacingText(text)).toBe(text);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("does not rewrite conversational billing/help text without errorContext", () => {
|
||||||
|
const text =
|
||||||
|
"If your API billing is low, top up credits in your provider dashboard and retry payment verification.";
|
||||||
|
expect(sanitizeUserFacingText(text)).toBe(text);
|
||||||
|
});
|
||||||
|
|
||||||
it("sanitizes raw API error payloads", () => {
|
it("sanitizes raw API error payloads", () => {
|
||||||
const raw = '{"type":"error","error":{"message":"Something exploded","type":"server_error"}}';
|
const raw = '{"type":"error","error":{"message":"Something exploded","type":"server_error"}}';
|
||||||
expect(sanitizeUserFacingText(raw, { errorContext: true })).toBe(
|
expect(sanitizeUserFacingText(raw, { errorContext: true })).toBe(
|
||||||
|
|||||||
Reference in New Issue
Block a user