mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 13:01:25 +00:00
chore (tui): add sanitizer regressions for narrow width safety
This commit is contained in:
@@ -132,6 +132,14 @@ describe("sanitizeRenderableText", () => {
|
|||||||
const sanitized = sanitizeRenderableText(input);
|
const sanitized = sanitizeRenderableText(input);
|
||||||
const longestSegment = Math.max(...sanitized.split(/\s+/).map((segment) => segment.length));
|
const longestSegment = Math.max(...sanitized.split(/\s+/).map((segment) => segment.length));
|
||||||
|
|
||||||
expect(longestSegment).toBeLessThanOrEqual(64);
|
expect(longestSegment).toBeLessThanOrEqual(32);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("breaks moderately long unbroken tokens to protect narrow terminals", () => {
|
||||||
|
const input = "b".repeat(90);
|
||||||
|
const sanitized = sanitizeRenderableText(input);
|
||||||
|
const longestSegment = Math.max(...sanitized.split(/\s+/).map((segment) => segment.length));
|
||||||
|
|
||||||
|
expect(longestSegment).toBeLessThanOrEqual(32);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user