Skip to content

Commit 0f75ee5

Browse files
committed
test: add svg constants timezone boundary coverage
1 parent 714e4dc commit 0f75ee5

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { describe, expect, it } from 'vitest';
2+
import { CONTRIBUTION_MILESTONES, STREAK_MILESTONES, SVG_HEIGHT, SVG_WIDTH } from './constants';
3+
4+
describe('SVG constants timezone boundary alignment', () => {
5+
it('maintains stable SVG dimensions across timezone offsets', () => {
6+
expect(SVG_WIDTH).toBe(600);
7+
expect(SVG_HEIGHT).toBe(420);
8+
});
9+
10+
it('preserves contribution milestone ordering during calendar date transitions', () => {
11+
const sorted = [...CONTRIBUTION_MILESTONES].sort((a, b) => a - b);
12+
expect(CONTRIBUTION_MILESTONES).toEqual(sorted);
13+
});
14+
15+
it('preserves streak milestone ordering across day boundary normalization', () => {
16+
const sorted = [...STREAK_MILESTONES].sort((a, b) => a - b);
17+
expect(STREAK_MILESTONES).toEqual(sorted);
18+
});
19+
20+
it('uses unique contribution milestones when activity shifts between dates', () => {
21+
expect(new Set(CONTRIBUTION_MILESTONES).size).toBe(CONTRIBUTION_MILESTONES.length);
22+
});
23+
24+
it('uses unique streak milestones during timezone rollover calculations', () => {
25+
expect(new Set(STREAK_MILESTONES).size).toBe(STREAK_MILESTONES.length);
26+
});
27+
});

0 commit comments

Comments
 (0)