File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -608,6 +608,34 @@ describe('calculateStreak', () => {
608608 expect ( result . longestStreak ) . toBe ( 10 ) ;
609609 expect ( result . currentStreak ) . toBe ( 3 ) ;
610610 } ) ;
611+
612+ it ( 'verify streak formulas for single day contribution timeline (Variation 3)' , ( ) => {
613+ // Simulating 1 day of commits, preceded and followed by empty weeks.
614+ // 7 empty days (1 week), 1 day of commits (1 contribution), 7 empty days (1 week)
615+ const calendar = buildCalendar ( [
616+ 0 ,
617+ 0 ,
618+ 0 ,
619+ 0 ,
620+ 0 ,
621+ 0 ,
622+ 0 , // Week 1: Empty week
623+ 1 , // 1 day of commits
624+ 0 ,
625+ 0 ,
626+ 0 ,
627+ 0 ,
628+ 0 ,
629+ 0 ,
630+ 0 , // Week 2: Empty week
631+ ] ) ;
632+
633+ const result = calculateStreak ( calendar ) ;
634+
635+ expect ( result . currentStreak ) . toBe ( 0 ) ;
636+ expect ( result . longestStreak ) . toBe ( 1 ) ;
637+ expect ( result . totalContributions ) . toBe ( 1 ) ;
638+ } ) ;
611639} ) ;
612640
613641it ( 'handles massive single-day commit spike timeline' , ( ) => {
You can’t perform that action at this time.
0 commit comments