release: WRNexusJS 0.5.14
This commit is contained in:
@@ -47,3 +47,23 @@ describe("theme accents", () => {
|
||||
expect(runtime).not.toContain("style.setProperty");
|
||||
});
|
||||
});
|
||||
test("live document accent has priority over cookie and default", () => {
|
||||
const runtime = renderThemeRuntime(
|
||||
resolveThemeConfig({
|
||||
palette: "rose",
|
||||
default: "light",
|
||||
accent: {
|
||||
default: "rose",
|
||||
options: ["rose", "emerald", "cyan"],
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
expect(runtime).toContain(
|
||||
'el.getAttribute("data-accent")||readCookie(ACCENT_COOKIE)||DEFAULT_ACCENT',
|
||||
);
|
||||
|
||||
expect(runtime).toContain(
|
||||
'el.getAttribute("data-theme")||readCookie(THEME_COOKIE)||DEFAULT_THEME',
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user