l0qp1n5qr: Give the disabled sparkle button a solid readable face

This commit is contained in:
2026-10-19 21:58:41 -06:00
parent 82dfe7308b
commit fcbaa174b6
3 changed files with 29 additions and 1 deletions
+12
View File
@@ -27,6 +27,18 @@ function rule(selector: string): string {
return m[1];
}
describe("SparkleButton disabled", () => {
it("keeps full opacity and a solid readable face", () => {
const body = rule(".btn-spark:disabled");
expect(body).toMatch(/opacity:\s*1\b/);
expect(body).toContain("var(--tile-3)");
expect(body).toContain("var(--ink-2)");
expect(body).toContain("not-allowed");
expect(readFileSync(path.resolve(__dirname, "../src/styles/legacy.css"), "utf8")).not.toMatch(/button:disabled\s*\{[^}]*opacity/);
expect(html(createElement(SparkleButton, { label: "Sign in", disabled: true }))).toContain("disabled");
});
});
describe("FlipButton states", () => {
it("ready: POST plus send icon, flips to PUBLISH with the icon", () => {
expect(flipLabels("ready")).toEqual({ front: "Post", back: "Publish", icon: true });