v0.34.4
This commit is contained in:
1 parent
ee174bc283
commit
52e7ce7b46
24 files changed
+672
-418
No files matched your search
@@ -0,0 +1,24 @@
|
||||
// Run with: node tests/acl_picker_corner_styles.cjs
|
||||
// The shared ACL picker must respect all dashboard corner-style presets without
|
||||
// relying on a separate radius setting or changing its selection behaviour.
|
||||
"use strict";
|
||||
const assert = require("node:assert/strict");
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
const css = fs.readFileSync(path.resolve(__dirname, "../src/admin/web/style.css"), "utf8");
|
||||
const parts = [
|
||||
".acl-picker-details", ".acl-picker-counter", ".acl-picker-option",
|
||||
".acl-picker-policy", ".acl-picker-tag", ".acl-picker-tag .acl-picker-remove"
|
||||
];
|
||||
for (const selector of parts) {
|
||||
const escaped = selector.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
const block = css.match(new RegExp(`${escaped}\\s*\\{([^}]+)\\}`));
|
||||
assert.ok(block, `Missing shared picker style: ${selector}`);
|
||||
assert.match(block[1], /border-radius:\s*var\(--rp-radius-control,\s*[^)]+\);/, `${selector} must use the dashboard control radius`);
|
||||
}
|
||||
for (const [preset, radius] of Object.entries({ square: 0, subtle: 4, rounded: 8, extra: 12 })) {
|
||||
const rule = css.match(new RegExp(`html\\[data-corner-style=${preset}\\]\\s*\\{([^}]+)\\}`));
|
||||
assert.ok(rule, `Missing corner-style preset: ${preset}`);
|
||||
assert.match(rule[1], new RegExp(`--rp-radius-control:\\s*${radius}px;`), `Unexpected radius for ${preset}`);
|
||||
}
|
||||
console.log("ACL picker corner styles: PASS (six surfaces, four presets, Original fallbacks)");
|
||||
Reference in new issue
Block a user