mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(theme): add halloween special theme
This commit is contained in:
@@ -26,10 +26,13 @@ describe('snow', () => {
|
||||
mathRandomSpy.mockRestore();
|
||||
});
|
||||
|
||||
it('prefers the special theme store and otherwise falls back to christmas dates', async () => {
|
||||
it('shows snow only for christmas special theme dates', async () => {
|
||||
const useSpecialThemeStore = (await import('../../stores/use-special-theme-store')).default;
|
||||
const { shouldShowSnow } = await import('../snow');
|
||||
|
||||
vi.useFakeTimers();
|
||||
vi.setSystemTime(new Date('2024-12-24T00:00:00Z'));
|
||||
|
||||
useSpecialThemeStore.setState({ isEnabled: true });
|
||||
expect(shouldShowSnow()).toBe(true);
|
||||
|
||||
@@ -37,10 +40,15 @@ describe('snow', () => {
|
||||
expect(shouldShowSnow()).toBe(false);
|
||||
|
||||
useSpecialThemeStore.setState({ isEnabled: null });
|
||||
vi.useFakeTimers();
|
||||
vi.setSystemTime(new Date('2024-12-24T00:00:00Z'));
|
||||
expect(shouldShowSnow()).toBe(true);
|
||||
|
||||
vi.setSystemTime(new Date('2024-10-31T00:00:00Z'));
|
||||
useSpecialThemeStore.setState({ isEnabled: true });
|
||||
expect(shouldShowSnow()).toBe(false);
|
||||
|
||||
useSpecialThemeStore.setState({ isEnabled: null });
|
||||
expect(shouldShowSnow()).toBe(false);
|
||||
|
||||
vi.setSystemTime(new Date('2024-07-04T00:00:00Z'));
|
||||
expect(shouldShowSnow()).toBe(false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user