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.
This commit is contained in:
1 file changed
Binary file not shown.
Reference in new issue
Block a user