Skip to content

Commit 5beebb0

Browse files
test(svg): add mouse interactivity coverage
1 parent 81d9f71 commit 5beebb0

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// lib/svg/constants.mouse-interactivity.test.ts
2+
3+
import { describe, expect, it } from 'vitest';
4+
import {
5+
SVG_WIDTH,
6+
SVG_HEIGHT,
7+
FONT_MAP,
8+
CONTRIBUTION_MILESTONES,
9+
STREAK_MILESTONES,
10+
} from './constants';
11+
12+
describe('SVG Constants Mouse Interactivity', () => {
13+
it('provides valid SVG dimensions for interactive layouts', () => {
14+
expect(SVG_WIDTH).toBeGreaterThan(0);
15+
expect(SVG_HEIGHT).toBeGreaterThan(0);
16+
});
17+
18+
it('exposes font mappings used by interactive SVG elements', () => {
19+
expect(FONT_MAP).toHaveProperty('jetbrains');
20+
expect(FONT_MAP).toHaveProperty('fira');
21+
expect(FONT_MAP).toHaveProperty('roboto');
22+
});
23+
24+
it('defines contribution milestone values in ascending order', () => {
25+
const sorted = [...CONTRIBUTION_MILESTONES].sort((a, b) => a - b);
26+
27+
expect(CONTRIBUTION_MILESTONES).toEqual(sorted);
28+
});
29+
30+
it('defines streak milestone values in ascending order', () => {
31+
const sorted = [...STREAK_MILESTONES].sort((a, b) => a - b);
32+
33+
expect(STREAK_MILESTONES).toEqual(sorted);
34+
});
35+
36+
it('contains milestone values suitable for interactive overlays', () => {
37+
expect(CONTRIBUTION_MILESTONES.length).toBeGreaterThan(0);
38+
expect(STREAK_MILESTONES.length).toBeGreaterThan(0);
39+
40+
expect(CONTRIBUTION_MILESTONES.every((v) => v > 0)).toBe(true);
41+
expect(STREAK_MILESTONES.every((v) => v > 0)).toBe(true);
42+
});
43+
});

0 commit comments

Comments
 (0)