import { storeToRefs } from 'pinia'; import { useThemeStore } from '@/stores/theme.store'; describe('theme store', () => { beforeEach(() => {}); it('should use default theme', () => { vi.spyOn(window.localStorage, 'getItem').mockReturnValueOnce('default'); const { theme } = storeToRefs(useThemeStore()); expect(theme.value).toBe('default'); }); it('should have theme preference', () => { vi.spyOn(window.localStorage, 'getItem').mockReturnValueOnce('dark'); const { prefersLight, prefersDark } = storeToRefs(useThemeStore()); expect(prefersLight.value || prefersDark.value).toBeTruthy(); }); });