Skip to content

Commit d6f9bd0

Browse files
test: add heatmap utils coverage
1 parent 35fb17e commit d6f9bd0

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { describe, expect, it } from 'vitest';
2+
3+
import { getIntensityColor } from './heatmapUtils';
4+
5+
describe('getIntensityColor', () => {
6+
it('returns the default gray class for intensity 0', () => {
7+
expect(getIntensityColor(0)).toBe('bg-gray-200 dark:bg-[#161616]');
8+
});
9+
10+
it('returns the correct class for intensity 1', () => {
11+
expect(getIntensityColor(1)).toBe('bg-gray-400 dark:bg-zinc-700');
12+
});
13+
14+
it('returns the correct class for intensity 2', () => {
15+
expect(getIntensityColor(2)).toBe('bg-gray-500 dark:bg-zinc-500');
16+
});
17+
18+
it('returns the correct class for intensity 3', () => {
19+
expect(getIntensityColor(3)).toBe('bg-gray-700 dark:bg-zinc-300');
20+
});
21+
22+
it('returns the correct class for intensity 4', () => {
23+
expect(getIntensityColor(4)).toBe('bg-black dark:bg-white');
24+
});
25+
26+
it('returns the default fallback class for intensity 99', () => {
27+
expect(getIntensityColor(99)).toBe('bg-gray-200 dark:bg-[#161616]');
28+
});
29+
30+
it('returns the default fallback class for intensity -1', () => {
31+
expect(getIntensityColor(-1)).toBe('bg-gray-200 dark:bg-[#161616]');
32+
});
33+
});

0 commit comments

Comments
 (0)