Keep the review card’s fallback color on the draft so a reload does not pick a new one.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilalloandCursor committed 2026-09-29 14:01:38 -06:00
1 parent 56adcd59fd
commit 6d536880fe
8 files changed
+165 -8

No files matched your search

+13
View File
@@ -1,5 +1,6 @@
import { describe, expect, it } from "vitest";
import {
isPreviewSurfaceColor,
mostCommonOpaqueColor,
randomPreviewSurfaceColor,
readableCardFill,
@@ -75,3 +76,15 @@ describe("randomPreviewSurfaceColor", () => {
);
});
});
describe("isPreviewSurfaceColor", () => {
it("accepts the hsl strings this module writes", () => {
expect(isPreviewSurfaceColor("hsl(12, 50%, 80%)")).toBe(true);
expect(isPreviewSurfaceColor("hsl(359, 84%, 87%)")).toBe(true);
});
it("rejects other CSS colors", () => {
expect(isPreviewSurfaceColor("rgb(12, 80, 40)")).toBe(false);
expect(isPreviewSurfaceColor("red")).toBe(false);
});
});