File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -509,4 +509,27 @@ describe('calculateWrappedStats', () => {
509509 expect ( result . busiestMonth ) . toBe ( '2024-01' ) ;
510510 expect ( result . weekendRatio ) . toBe ( 100 ) ;
511511 } ) ;
512+ // =========================================================================
513+ // ISSUE OBJECTIVE: Verify weekendRatio is 100 when all commits are on weekends
514+ // =========================================================================
515+ it ( 'returns weekendRatio === 100 when all contributions are on weekends' , ( ) => {
516+ // Note: 2026-05-02 is a Saturday, 2026-05-03 is a Sunday, 2026-05-04 is a Monday
517+ const weekendCalendar = {
518+ totalContributions : 10 ,
519+ weeks : [
520+ {
521+ contributionDays : [
522+ { date : '2026-05-02' , contributionCount : 5 } , // Saturday (Weekend)
523+ { date : '2026-05-03' , contributionCount : 5 } , // Sunday (Weekend)
524+ { date : '2026-05-04' , contributionCount : 0 } , // Monday (Weekday - 0 commits)
525+ ] ,
526+ } ,
527+ ] ,
528+ } as Parameters < typeof calculateWrappedStats > [ 0 ] ; // Safely infers the exact type the function expects!
529+
530+ const result = calculateWrappedStats ( weekendCalendar ) ;
531+
532+ // Assert the ratio is exactly 100%
533+ expect ( result . weekendRatio ) . toBe ( 100 ) ;
534+ } ) ;
512535} ) ;
You can’t perform that action at this time.
0 commit comments