DrSmoothl
2913a7a19b
test(webui): regression tests for ui-config normalizers (B4)
First test coverage for the WebUI config trust boundary + the B1–B3 schema
additions (22 cases in packages/core/tests):
- normalizeAppearance totality (garbage → defaults, clamps, bad enums); custom
fonts accept free-form families but reject control chars/injection/over-length;
cssVars keep only whitelisted tokens with break-out-proof colour values.
- normalizeLayout: overviewMobile/topbarItems order-preserving + de-duped +
fallback; overviewBlocks coord clamping; per-widget config 4096-byte cap.
- normalizePages: logs preset oneOf (unknown → custom).
- sniffImageMime magic bytes; normalizeUiConfig never derives image fields from
the value.
- fs-backed (isolated temp cwd + fresh module): saveUiConfig forces the
server-managed image fields (client can't forge hasImage); publicAppearance
strips customCss but keeps cssVars + other cosmetic fields.
2026-06-16 14:38:57 +08:00
..
2026-05-23 23:31:03 +08:00
2026-06-01 14:35:57 +08:00
2026-05-23 23:31:03 +08:00
2026-05-23 23:31:03 +08:00
2026-05-23 23:31:03 +08:00
2026-05-30 22:52:15 +08:00
2026-06-11 20:47:54 +08:00
2026-06-14 19:11:03 +08:00
2026-05-21 08:27:05 +08:00
2026-05-29 17:37:10 +08:00
2026-05-23 23:31:03 +08:00
2026-05-21 08:27:05 +08:00
2026-05-21 08:27:05 +08:00
2026-06-09 16:30:10 +08:00
2026-05-23 23:31:03 +08:00
2026-05-16 21:31:54 +08:00
2026-06-16 14:38:57 +08:00