File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments