feat(theme): add halloween special theme

This commit is contained in:
Tommaso Casaburi
2026-05-29 17:45:18 +07:00
parent e082c7b428
commit 0469f61a45
14 changed files with 301 additions and 35 deletions
+10 -1
View File
@@ -12,7 +12,7 @@ import {
} from '../replies-preview-utils';
import { getQuotedCidsFromContent, mergeQuotedCids } from '../reply-quote-utils';
import { formatUserIDForDisplay, truncateWithEllipsisInMiddle } from '../string-utils';
import { getFormattedDate, getFormattedTimeAgo, isChristmas } from '../time-utils';
import { getActiveSpecialTheme, getFormattedDate, getFormattedTimeAgo, getSpecialThemeClass, isChristmas, isHalloween } from '../time-utils';
const testState = vi.hoisted(() => ({
language: 'en',
@@ -276,8 +276,17 @@ describe('misc utils', () => {
vi.setSystemTime(new Date('2024-12-24T00:00:00Z'));
expect(isChristmas()).toBe(true);
expect(getActiveSpecialTheme()).toBe('christmas');
expect(getSpecialThemeClass('christmas')).toBe('tomorrow');
vi.setSystemTime(new Date('2024-10-31T00:00:00Z'));
expect(isHalloween()).toBe(true);
expect(getActiveSpecialTheme()).toBe('halloween');
expect(getSpecialThemeClass('halloween')).toBe('spooky');
vi.setSystemTime(new Date('2024-07-04T00:00:00Z'));
expect(isChristmas()).toBe(false);
expect(isHalloween()).toBe(false);
expect(getActiveSpecialTheme()).toBeNull();
});
});