Skip to content

Commit 59be971

Browse files
committed
test: add svg constants responsive breakpoint coverage
1 parent 714e4dc commit 59be971

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { describe, expect, it } from 'vitest';
2+
import { CONTRIBUTION_MILESTONES, STREAK_MILESTONES, SVG_HEIGHT, SVG_WIDTH } from './constants';
3+
4+
describe('SVG constants responsive breakpoint behavior', () => {
5+
it('maintains positive SVG dimensions for mobile viewports', () => {
6+
expect(SVG_WIDTH).toBeGreaterThan(0);
7+
expect(SVG_HEIGHT).toBeGreaterThan(0);
8+
});
9+
10+
it('preserves aspect ratio across responsive screen sizes', () => {
11+
const aspectRatio = SVG_WIDTH / SVG_HEIGHT;
12+
13+
expect(aspectRatio).toBeGreaterThan(1);
14+
});
15+
16+
it('provides milestone arrays suitable for multi-device rendering', () => {
17+
expect(CONTRIBUTION_MILESTONES.length).toBeGreaterThan(0);
18+
expect(STREAK_MILESTONES.length).toBeGreaterThan(0);
19+
});
20+
21+
it('keeps contribution milestones ordered for column layout rendering', () => {
22+
const sorted = [...CONTRIBUTION_MILESTONES].sort((a, b) => a - b);
23+
24+
expect(CONTRIBUTION_MILESTONES).toEqual(sorted);
25+
});
26+
27+
it('keeps streak milestones ordered for responsive grid rendering', () => {
28+
const sorted = [...STREAK_MILESTONES].sort((a, b) => a - b);
29+
30+
expect(STREAK_MILESTONES).toEqual(sorted);
31+
});
32+
});

0 commit comments

Comments
 (0)