Skip to content

Commit cbaa93f

Browse files
authored
test(svg): add tests for auto-theme SVG dark palette (JhaSourav07#634)
## Description Fixes JhaSourav07#389 ## Pillar - [ ] 🎨 Pillar 1 β€” New Theme Design - [ ] πŸ“ Pillar 2 β€” Geometric SVG Improvement - [ ] πŸ• Pillar 3 β€” Timezone Logic Optimization - [x] πŸ› οΈ Other (Bug fix, refactoring, docs) ## Visual Preview No visual changes, just adding tests. ## 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 server for faster collaboration, mentorship, and PR support.
2 parents 4fa31bf + 3151d4f commit cbaa93f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

β€Žlib/svg/generator.test.tsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,13 @@ describe('generateSVG', () => {
204204
expect(svg).toContain('--cp-accent: #0969da');
205205
});
206206

207-
it('injects @media (prefers-color-scheme: dark) with dark palette', () => {
207+
it('injects @media (prefers-color-scheme: dark) with exact dark palette hex values', () => {
208208
const svg = generateSVG(mockStats, autoParams, mockCalendar);
209209

210210
// Media query block must be present
211211
expect(svg).toContain('prefers-color-scheme: dark');
212212

213-
// Dark-mode CSS variables inside the media query
213+
// Check for exact hex values used in AUTO_DARK_THEME
214214
expect(svg).toContain('--cp-bg: #0d1117');
215215
expect(svg).toContain('--cp-text: #c9d1d9');
216216
expect(svg).toContain('--cp-accent: #58a6ff');

0 commit comments

Comments
Β (0)