complete UI CSS ownership remediation
This commit is contained in:
@@ -28,17 +28,33 @@ test("bundled UI assets are discoverable and readable", () => {
|
||||
|
||||
test("global UI CSS stays below its migration ratchet", () => {
|
||||
const css = uiCss();
|
||||
expect(gzipSync(new TextEncoder().encode(css)).length).toBeLessThanOrEqual(9_338);
|
||||
expect(gzipSync(new TextEncoder().encode(css)).length).toBeLessThanOrEqual(3_762);
|
||||
for (const localOrRemovedFamily of [
|
||||
".wire-switch",
|
||||
".wire-alert",
|
||||
".wire-card",
|
||||
".wire-footer",
|
||||
".wire-metric-card",
|
||||
".wire-segmented-group",
|
||||
".wire-dropdown",
|
||||
".wire-btn",
|
||||
".wire-next",
|
||||
]) {
|
||||
expect(css).not.toContain(localOrRemovedFamily);
|
||||
}
|
||||
});
|
||||
|
||||
test("components do not carry the standalone wire-next generation artifact", () => {
|
||||
const offenders = uiComponentNames().filter((name) => {
|
||||
const source = readFileSync(uiComponentPath(name), "utf8");
|
||||
return [...source.matchAll(/class=["']([^"']*)["']/g)].some((match) =>
|
||||
match[1]!.split(/\s+/).includes("wire-next"),
|
||||
);
|
||||
});
|
||||
|
||||
expect(offenders).toEqual([]);
|
||||
});
|
||||
|
||||
test("every bundled component carries local styles", () => {
|
||||
const unstyled = uiComponentNames().filter(
|
||||
(name) => !/^\s{2,4}style \{/m.test(readFileSync(uiComponentPath(name), "utf8")),
|
||||
@@ -460,7 +476,10 @@ test("component-system CSS includes responsive, theme-token, focus, and reduced-
|
||||
expect(css).toContain(".wire-bg-primary");
|
||||
expect(css).toContain(".wire-text-muted");
|
||||
expect(css).toContain(".wire-visually-hidden");
|
||||
expect(css).toContain(".wire-next--field");
|
||||
expect(css).not.toContain(".wire-next--field");
|
||||
expect(
|
||||
readFileSync(join(uiComponentsDir(), "..", "styles", "FieldStyles.wrn"), "utf8"),
|
||||
).toContain(".wire-next--field");
|
||||
expect(css).toContain('[data-show="false"]');
|
||||
expect(css).toContain("display: none !important");
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user