@@ -166,7 +166,7 @@ describe("custom theme import helpers", () => {
|
166 | 166 | expect(imported.light.bg).toBe("oklch(0.98 0.01 120)"); |
167 | 167 | expect(imported.dark.bg).toBe("oklch(0.12 0.04 265)"); |
168 | 168 | expect(imported.light["font-body"]).toBe("Inter, system-ui, sans-serif"); |
169 | | -expect(imported.dark["accent-hover"]).toContain("color-mix"); |
| 169 | +expect(imported.dark["accent-hover"]).toBe("color-mix(in srgb, var(--accent) 82%, white 18%)"); |
170 | 170 | }); |
171 | 171 | |
172 | 172 | it("fetches tweakcn themes with bounded no-redirect requests", async () => { |
@@ -286,11 +286,16 @@ describe("custom theme import helpers", () => {
|
286 | 286 | |
287 | 287 | it("builds stable CSS blocks for custom dark and light themes", () => { |
288 | 288 | const css = buildCustomThemeStyles(createImportedTheme()); |
289 | | - |
290 | | -expect(css).toContain(':root[data-theme="custom"]'); |
291 | | -expect(css).toContain(':root[data-theme="custom-light"]'); |
292 | | -expect(css).toContain("--bg: oklch(0.12 0.04 265);"); |
293 | | -expect(css).toContain("--bg: oklch(0.98 0.01 120);"); |
| 289 | +const selectorAndBackgroundLines = css |
| 290 | +.split("\n") |
| 291 | +.filter((line) => line.startsWith(":root") || line.trim().startsWith("--bg:")); |
| 292 | + |
| 293 | +expect(selectorAndBackgroundLines).toEqual([ |
| 294 | +':root[data-theme="custom"] {', |
| 295 | +" --bg: oklch(0.12 0.04 265);", |
| 296 | +':root[data-theme="custom-light"] {', |
| 297 | +" --bg: oklch(0.98 0.01 120);", |
| 298 | +]); |
294 | 299 | }); |
295 | 300 | |
296 | 301 | it("throws when stored custom theme tokens are missing", () => { |
|