This commit is contained in:
1 parent
8efd032cc6
commit
df38dccbf1
735 files changed
+128321
-120870
No files matched your search
@@ -1,22 +1,22 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { presetSettings, settingKey } from "@/lib/theme-settings";
|
||||
import { PRESETS, THEME_COLOR_KEYS } from "@/lib/theme-presets";
|
||||
import { presetSettings, settingKey } from "@/lib/theme-settings";
|
||||
|
||||
describe("theme settings mapping", () => {
|
||||
it("keeps legacy light keys and suffixes dark keys", () => {
|
||||
expect(settingKey("color_primary", "light")).toBe("color_primary");
|
||||
expect(settingKey("color_primary", "dark")).toBe("color_primary_dark");
|
||||
});
|
||||
it("keeps legacy light keys and suffixes dark keys", () => {
|
||||
expect(settingKey("color_primary", "light")).toBe("color_primary");
|
||||
expect(settingKey("color_primary", "dark")).toBe("color_primary_dark");
|
||||
});
|
||||
|
||||
it("serializes every preset key for both modes without duplicates", () => {
|
||||
const settings = presetSettings(PRESETS.Ocean);
|
||||
const keys = settings.map(([key]) => key);
|
||||
it("serializes every preset key for both modes without duplicates", () => {
|
||||
const settings = presetSettings(PRESETS.Ocean);
|
||||
const keys = settings.map(([key]) => key);
|
||||
|
||||
expect(settings).toHaveLength(THEME_COLOR_KEYS.length * 2);
|
||||
expect(new Set(keys).size).toBe(keys.length);
|
||||
for (const key of THEME_COLOR_KEYS) {
|
||||
expect(keys).toContain(key);
|
||||
expect(keys).toContain(`${key}_dark`);
|
||||
}
|
||||
});
|
||||
expect(settings).toHaveLength(THEME_COLOR_KEYS.length * 2);
|
||||
expect(new Set(keys).size).toBe(keys.length);
|
||||
for (const key of THEME_COLOR_KEYS) {
|
||||
expect(keys).toContain(key);
|
||||
expect(keys).toContain(`${key}_dark`);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user