Bound style components and unify button style validation
Quality / quality (ubuntu-latest) (push) Failing after 25m18s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
Clintchiz committed 2026-09-05 19:08:47 +05:30
1 parent 14669bb4f3
commit 1f90e01e6e
4 files changed
+38 -9

No files matched your search

@@ -11,3 +11,13 @@ test("base style syntax rejects ignored or injected values and accepts supported
expect(() => validateEmailStyleValue(key!, value!)).not.toThrow();
}
});
test("RGB functions require correct channel counts, units and bounded components", () => {
for (const value of ["rgb(1)", "rgb(1,2,3,4)", "rgba(1,2,3)", "rgb(256,0,0)", "rgb(100%,0,0)", "rgba(1,2,3,1.1)", "rgb(1..2,2,3)", "rgba(0,0,0,101%)"])
expect(emailStyleValue("color", value)).toBe("");
for (const value of ["rgb(255, 0, 12)", "rgb(100%, 0%, 50%)", "rgba(0,0,0,.5)", "rgba(0,0,0,50%)", "transparent"])
expect(emailStyleValue("backgroundColor", value)).toBe(value);
expect(emailStyleValue("padding", "0 4000px")).toBe("0 4000px");
expect(emailStyleValue("padding", "0 4001px")).toBe("");
expect(emailStyleValue("fontSize", "999999999999999999999px")).toBe("");
});