@@ -102,11 +102,11 @@ describe("postCalendar function", () => {
102
102
secondDay . fromDate = new Date ( 0 , 0 , 0 , 8 ) ;
103
103
secondDay . toDate = new Date ( 0 , 0 , 0 , 17 ) ;
104
104
const firstWorkingTime = new WorkingTime ( )
105
- firstWorkingTime . fromTime = new Date ( 0 , 0 , 0 , 8 ) ;
106
- firstWorkingTime . toTime = new Date ( 0 , 0 , 0 , 13 ) ;
105
+ firstWorkingTime . fromTime = new Date ( Date . UTC ( 0 , 0 , 0 , 8 ) ) ;
106
+ firstWorkingTime . toTime = new Date ( Date . UTC ( 0 , 0 , 0 , 13 ) ) ;
107
107
const secondWorkingTime = new WorkingTime ( )
108
- secondWorkingTime . fromTime = new Date ( 0 , 0 , 0 , 14 ) ;
109
- secondWorkingTime . toTime = new Date ( 0 , 0 , 0 , 17 ) ;
108
+ secondWorkingTime . fromTime = new Date ( Date . UTC ( 0 , 0 , 0 , 14 ) ) ;
109
+ secondWorkingTime . toTime = new Date ( Date . UTC ( 0 , 0 , 0 , 17 ) ) ;
110
110
secondDay . workingTimes = [ firstWorkingTime , secondWorkingTime ] ;
111
111
request1 . calendar . days = [ firstDay , secondDay ] ;
112
112
request1 . calendar . isBaseCalendar = false ;
@@ -130,10 +130,10 @@ describe("postCalendar function", () => {
130
130
const monday = result2 . body . calendar . days . find ( d => d . dayType === DayType . Monday ) ;
131
131
expect ( monday ) . is . not . null . and . not . undefined ;
132
132
expect ( monday . workingTimes . length ) . to . equal ( 2 ) ;
133
- expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 0 ] . fromTime ) ) . to . eql ( BaseTest . getTimeOnly ( new Date ( 0 , 0 , 0 , 8 ) ) ) ;
134
- expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 0 ] . toTime ) ) . to . eql ( BaseTest . getTimeOnly ( new Date ( 0 , 0 , 0 , 13 ) ) ) ;
135
- expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 1 ] . fromTime ) ) . to . eql ( BaseTest . getTimeOnly ( new Date ( 0 , 0 , 0 , 14 ) ) ) ;
136
- expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 1 ] . toTime ) ) . to . eql ( BaseTest . getTimeOnly ( new Date ( 0 , 0 , 0 , 17 ) ) ) ;
133
+ expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 0 ] . fromTime ) ) . to . eql ( BaseTest . getTimeOnly ( firstWorkingTime . fromTime ) ) ;
134
+ expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 0 ] . toTime ) ) . to . eql ( BaseTest . getTimeOnly ( firstWorkingTime . toTime ) ) ;
135
+ expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 1 ] . fromTime ) ) . to . eql ( BaseTest . getTimeOnly ( secondWorkingTime . fromTime ) ) ;
136
+ expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 1 ] . toTime ) ) . to . eql ( BaseTest . getTimeOnly ( secondWorkingTime . toTime ) ) ;
137
137
} ) ;
138
138
139
139
it ( "should return response with code 400 if workingTimes is empty for any working day" , async ( ) => {
@@ -198,14 +198,14 @@ describe("putCalendar function", () => {
198
198
const secondDay = new WeekDay ( ) ;
199
199
secondDay . dayType = DayType . Monday ;
200
200
secondDay . dayWorking = true ;
201
- secondDay . fromDate = new Date ( 0 , 0 , 0 , 8 ) ;
202
- secondDay . toDate = new Date ( 0 , 0 , 0 , 17 ) ;
201
+ secondDay . fromDate = new Date ( Date . UTC ( 0 , 0 , 0 , 8 ) ) ;
202
+ secondDay . toDate = new Date ( Date . UTC ( 0 , 0 , 0 , 17 ) ) ;
203
203
const firstWorkingTime = new WorkingTime ( )
204
- firstWorkingTime . fromTime = new Date ( 0 , 0 , 0 , 8 ) ;
205
- firstWorkingTime . toTime = new Date ( 0 , 0 , 0 , 13 ) ;
204
+ firstWorkingTime . fromTime = new Date ( Date . UTC ( 0 , 0 , 0 , 8 ) ) ;
205
+ firstWorkingTime . toTime = new Date ( Date . UTC ( 0 , 0 , 0 , 13 ) ) ;
206
206
const secondWorkingTime = new WorkingTime ( )
207
- secondWorkingTime . fromTime = new Date ( 0 , 0 , 0 , 14 ) ;
208
- secondWorkingTime . toTime = new Date ( 0 , 0 , 0 , 17 ) ;
207
+ secondWorkingTime . fromTime = new Date ( Date . UTC ( 0 , 0 , 0 , 14 ) ) ;
208
+ secondWorkingTime . toTime = new Date ( Date . UTC ( 0 , 0 , 0 , 17 ) ) ;
209
209
secondDay . workingTimes = [ firstWorkingTime , secondWorkingTime ] ;
210
210
request1 . calendar . days = [ firstDay , secondDay ] ;
211
211
request1 . calendar . isBaseCalendar = false ;
@@ -228,10 +228,10 @@ describe("putCalendar function", () => {
228
228
const monday = result2 . body . calendar . days . find ( d => d . dayType === DayType . Monday ) ;
229
229
expect ( monday ) . is . not . null . and . not . undefined ;
230
230
expect ( monday . workingTimes . length ) . to . equal ( 2 ) ;
231
- expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 0 ] . fromTime ) ) . to . eql ( BaseTest . getTimeOnly ( new Date ( 0 , 0 , 0 , 8 ) ) ) ;
232
- expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 0 ] . toTime ) ) . to . eql ( BaseTest . getTimeOnly ( new Date ( 0 , 0 , 0 , 13 ) ) ) ;
233
- expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 1 ] . fromTime ) ) . to . eql ( BaseTest . getTimeOnly ( new Date ( 0 , 0 , 0 , 14 ) ) ) ;
234
- expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 1 ] . toTime ) ) . to . eql ( BaseTest . getTimeOnly ( new Date ( 0 , 0 , 0 , 17 ) ) ) ;
231
+ expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 0 ] . fromTime ) ) . to . eql ( BaseTest . getTimeOnly ( firstWorkingTime . fromTime ) ) ;
232
+ expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 0 ] . toTime ) ) . to . eql ( BaseTest . getTimeOnly ( firstWorkingTime . toTime ) ) ;
233
+ expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 1 ] . fromTime ) ) . to . eql ( BaseTest . getTimeOnly ( secondWorkingTime . fromTime ) ) ;
234
+ expect ( BaseTest . getTimeOnly ( monday . workingTimes [ 1 ] . toTime ) ) . to . eql ( BaseTest . getTimeOnly ( secondWorkingTime . toTime ) ) ;
235
235
} ) ;
236
236
} ) ;
237
237
0 commit comments