Skip to content

Commit f4ddd7f

Browse files
authored
test(layoutConstants): create layoutConstants tests (JhaSourav07#1192)
## Description Fixes JhaSourav07#1015 Added a new test file for `lib/svg/layoutConstants.ts` covering all exported layout constants. Tests included: * `GHOST_HEIGHT_PX === 4` * `LOG_SCALE_MULTIPLIER === 12` * `LINEAR_SCALE_MULTIPLIER === 5` * `MAX_LOG_HEIGHT === 80` * `MAX_LINEAR_HEIGHT === 50` ## Pillar * [ ] 🎨 Pillar 1 — New Theme Design * [ ] 📐 Pillar 2 — Geometric SVG Improvement * [ ] 🕐 Pillar 3 — Timezone Logic Optimization * [x] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview N/A (test-only change) ## Checklist before requesting a review: * [x] I have read the `CONTRIBUTING.md` file. * [ ] 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): ...`). * [ ] 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. * [ ] 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 fbdd8e4 + 6f80dd8 commit f4ddd7f

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

lib/svg/layoutConstants.test.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { describe, it, expect } from 'vitest';
2+
import {
3+
GHOST_HEIGHT_PX,
4+
LOG_SCALE_MULTIPLIER,
5+
LINEAR_SCALE_MULTIPLIER,
6+
MAX_LOG_HEIGHT,
7+
MAX_LINEAR_HEIGHT,
8+
} from './layoutConstants';
9+
10+
describe('layoutConstants', () => {
11+
it('GHOST_HEIGHT_PX equals 4', () => {
12+
expect(GHOST_HEIGHT_PX).toBe(4);
13+
});
14+
15+
it('LOG_SCALE_MULTIPLIER equals 12', () => {
16+
expect(LOG_SCALE_MULTIPLIER).toBe(12);
17+
});
18+
19+
it('LINEAR_SCALE_MULTIPLIER equals 5', () => {
20+
expect(LINEAR_SCALE_MULTIPLIER).toBe(5);
21+
});
22+
23+
it('MAX_LOG_HEIGHT equals 80', () => {
24+
expect(MAX_LOG_HEIGHT).toBe(80);
25+
});
26+
27+
it('MAX_LINEAR_HEIGHT equals 50', () => {
28+
expect(MAX_LINEAR_HEIGHT).toBe(50);
29+
});
30+
});

0 commit comments

Comments
 (0)