File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,6 +100,32 @@ describe('computeTowers edge cases', () => {
100100 expect ( towers [ 0 ] . strokeWidth ) . toBe ( 0.5 ) ;
101101 } ) ;
102102
103+ it ( 'marks every tower as a ghost with ghost height for an all-zero calendar' , ( ) => {
104+ const calendar = {
105+ totalContributions : 0 ,
106+ weeks : [
107+ {
108+ contributionDays : [
109+ { contributionCount : 0 , date : '2024-06-10' } ,
110+ { contributionCount : 0 , date : '2024-06-11' } ,
111+ ] ,
112+ } ,
113+ {
114+ contributionDays : [
115+ { contributionCount : 0 , date : '2024-06-12' } ,
116+ { contributionCount : 0 , date : '2024-06-13' } ,
117+ ] ,
118+ } ,
119+ ] ,
120+ } as unknown as ContributionCalendar ;
121+ const towers = computeTowers ( calendar , 'linear' , '2024-06-13' ) ;
122+
123+ towers . forEach ( ( tower ) => {
124+ expect ( tower . isGhost ) . toBe ( true ) ;
125+ expect ( tower . h ) . toBe ( 4 ) ; // GHOST_HEIGHT_PX
126+ } ) ;
127+ } ) ;
128+
103129 it ( 'disables ghost city mode when total visible contributions > 0' , ( ) => {
104130 const calendar = {
105131 totalContributions : 0 ,
You can’t perform that action at this time.
0 commit comments