@@ -46,15 +46,15 @@ describe('schedule utils', () => {
4646 it ( 'returns true when date falls within a slot' , ( ) => {
4747 const monday9am = new Date ( 2025 , 2 , 10 , 9 , 30 ) ;
4848 const schedule = {
49- weekly : [ { day : 'monday' , start : '09:00' , end : '17:00' } ]
49+ weekly : [ { day : 'monday' , start : '09:00' , duration : 8 } ]
5050 } ;
5151 expect ( isWithinSchedule ( schedule , monday9am ) ) . toBe ( true ) ;
5252 } ) ;
5353
5454 it ( 'returns false when date is outside all slots' , ( ) => {
5555 const monday8am = new Date ( 2025 , 2 , 10 , 8 , 0 ) ;
5656 const schedule = {
57- weekly : [ { day : 'monday' , start : '09:00' , end : '17:00' } ]
57+ weekly : [ { day : 'monday' , start : '09:00' , duration : 8 } ]
5858 } ;
5959 expect ( isWithinSchedule ( schedule , monday8am ) ) . toBe ( false ) ;
6060 } ) ;
@@ -63,7 +63,7 @@ describe('schedule utils', () => {
6363 const monday9am = new Date ( 2025 , 2 , 10 , 9 , 0 ) ;
6464 const monday5pm = new Date ( 2025 , 2 , 10 , 17 , 0 ) ;
6565 const schedule = {
66- weekly : [ { day : 'monday' , start : '09:00' , end : '17:00' } ]
66+ weekly : [ { day : 'monday' , start : '09:00' , duration : 8 } ]
6767 } ;
6868 expect ( isWithinSchedule ( schedule , monday9am ) ) . toBe ( true ) ;
6969 expect ( isWithinSchedule ( schedule , monday5pm ) ) . toBe ( false ) ;
@@ -73,8 +73,8 @@ describe('schedule utils', () => {
7373 const wednesday2pm = new Date ( 2025 , 2 , 12 , 14 , 0 ) ;
7474 const schedule = {
7575 weekly : [
76- { day : 'monday' , start : '09:00' , end : '17:00' } ,
77- { day : 'wednesday' , start : '12:00' , end : '18:00' }
76+ { day : 'monday' , start : '09:00' , duration : 8 } ,
77+ { day : 'wednesday' , start : '12:00' , duration : 6 }
7878 ]
7979 } ;
8080 expect ( isWithinSchedule ( schedule , wednesday2pm ) ) . toBe ( true ) ;
0 commit comments