Skip to content

Commit ed8fa3d

Browse files
authored
test: add coverage for AUTO_THEME_LIGHT and AUTO_THEME_DARK exports (JhaSourav07#1214)
## Description Adds test coverage for the renamed auto theme exports to ensure they continue referencing the correct theme objects. ## Changes Extended lib/svg/themes.test.ts Added test verifying AUTO_THEME_LIGHT === themes.light Added test verifying AUTO_THEME_DARK === themes.dark Added test verifying AUTO_THEME_LIGHT.bg === themes.light.bg Added test verifying AUTO_THEME_DARK.accent === themes.dark.accent Fixes JhaSourav07#1075 ## Pillar - [x] 🎨 Pillar 1 — New Theme Design - [x] 📐 Pillar 2 — Geometric SVG Improvement - [x] 🛠️ Other (Bug fix, refactoring, docs) ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have tested these changes locally (`localhost:3000/api/streak?user=YOUR_USERNAME`). - [x] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will fail otherwise). - [x] My commits follow the Conventional Commits format (e.g., `feat(themes): ...`, `fix(calculate): ...`). - [x] I have updated `README.md` if I added a new theme or URL parameter. - [x] I have started the repo. - [x] I have made sure that i have only one commit to merge in this PR. - [x] The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts). - [x] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
2 parents 0ec4b46 + 66a1a4a commit ed8fa3d

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

lib/svg/themes.test.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from 'vitest';
2-
import { themes } from './themes';
2+
import { themes, AUTO_THEME_LIGHT, AUTO_THEME_DARK } from './themes';
33

44
describe('themes', () => {
55
it('should not use # prefix in background colors', () => {
@@ -19,4 +19,19 @@ describe('themes', () => {
1919
expect(theme.accent.startsWith('#')).toBe(false);
2020
});
2121
});
22+
it('AUTO_THEME_LIGHT references themes.light', () => {
23+
expect(AUTO_THEME_LIGHT).toBe(themes.light);
24+
});
25+
26+
it('AUTO_THEME_DARK references themes.dark', () => {
27+
expect(AUTO_THEME_DARK).toBe(themes.dark);
28+
});
29+
30+
it('AUTO_THEME_LIGHT bg matches themes.light.bg', () => {
31+
expect(AUTO_THEME_LIGHT.bg).toBe(themes.light.bg);
32+
});
33+
34+
it('AUTO_THEME_DARK accent matches themes.dark.accent', () => {
35+
expect(AUTO_THEME_DARK.accent).toBe(themes.dark.accent);
36+
});
2237
});

0 commit comments

Comments
 (0)