feat: add withPersistence state, change theme state

This commit is contained in:
2026-02-11 11:46:13 +05:00
parent bfca034ec8
commit 9e1eeb57bc
14 changed files with 438 additions and 328 deletions
+7 -7
View File
@@ -5,27 +5,27 @@ import LayoutTest from "./LayoutTest.svelte";
describe("+layout.svelte", () => {
beforeEach(() => {
themeState.theme = "dark";
themeState.current = "dark";
vi.clearAllMocks();
});
it("should apply dark theme", () => {
themeState.theme = "dark";
themeState.current = "dark";
expect(themeState.theme).toBe("dark");
expect(themeState.current).toBe("dark");
});
it("should apply light theme", () => {
themeState.theme = "light";
themeState.current = "light";
expect(themeState.theme).toBe("light");
expect(themeState.current).toBe("light");
});
it("should toggle theme", () => {
themeState.theme = "dark";
themeState.current = "dark";
themeState.toggle();
expect(themeState.theme).toBe("light");
expect(themeState.current).toBe("light");
});
});