@@ -377,6 +377,52 @@ describe('generateSVG', () => {
377377 expect ( svg ) . not . toContain ( 'attributeName="opacity" values="1;0.4;1"' ) ;
378378 } ) ;
379379 } ) ;
380+
381+ describe ( 'tower top highlight' , ( ) => {
382+ it ( 'renders white highlight on tower top when contributionCount > 5' , ( ) => {
383+ const calendarWithHighCount : ContributionCalendar = {
384+ totalContributions : 9 ,
385+ weeks : [
386+ {
387+ contributionDays : [
388+ { contributionCount : 6 , date : '2024-06-10' } ,
389+ { contributionCount : 3 , date : '2024-06-11' } ,
390+ ] ,
391+ } ,
392+ ] ,
393+ } ;
394+
395+ const svg = generateSVG (
396+ mockStats ,
397+ { user : 'avi' } as unknown as BadgeParams ,
398+ calendarWithHighCount
399+ ) ;
400+
401+ expect ( svg ) . toContain ( 'fill="white" fill-opacity="0.2"' ) ;
402+ } ) ;
403+
404+ it ( 'does not render white highlight when all days have contributionCount <= 5' , ( ) => {
405+ const calendarWithLowCount : ContributionCalendar = {
406+ totalContributions : 8 ,
407+ weeks : [
408+ {
409+ contributionDays : [
410+ { contributionCount : 3 , date : '2024-06-10' } ,
411+ { contributionCount : 5 , date : '2024-06-11' } ,
412+ ] ,
413+ } ,
414+ ] ,
415+ } ;
416+
417+ const svg = generateSVG (
418+ mockStats ,
419+ { user : 'avi' } as unknown as BadgeParams ,
420+ calendarWithLowCount
421+ ) ;
422+
423+ expect ( svg ) . not . toContain ( 'fill="white" fill-opacity="0.2"' ) ;
424+ } ) ;
425+ } ) ;
380426} ) ;
381427
382428describe ( 'generateMonthlySVG' , ( ) => {
0 commit comments