@@ -185,8 +185,8 @@ describe('ExpandableCalendar', () => {
185185 jest . runAllTimers ( ) ;
186186 const expectedDate = today . clone ( ) . setDate ( 1 ) . addMonths ( direction === Direction . RIGHT ? 1 : - 1 ) ;
187187 driver . pressOnHeaderArrow ( { left : direction === Direction . LEFT } ) ;
188- expect ( onDateChanged ) . toHaveBeenCalledWith ( toMarkingFormat ( expectedDate ) , UpdateSources . ARROW_PRESS ) ;
189- expect ( onMonthChange ) . toHaveBeenCalledWith ( xdateToData ( expectedDate ) , UpdateSources . ARROW_PRESS ) ;
188+ expect ( onDateChanged ) . toHaveBeenCalledWith ( toMarkingFormat ( expectedDate ) , UpdateSources . PAGE_SCROLL ) ;
189+ expect ( onMonthChange ) . toHaveBeenCalledWith ( xdateToData ( expectedDate ) , UpdateSources . PAGE_SCROLL ) ;
190190 } ) ;
191191
192192 it ( `should call onDateChanged and onMonthChanged for first day in initial month when changing to initial month` , ( ) => {
@@ -197,8 +197,8 @@ describe('ExpandableCalendar', () => {
197197 driver . pressOnHeaderArrow ( { left : true } ) ;
198198 jest . runAllTimers ( ) ;
199199 const expectedDate = today . clone ( ) . setDate ( 1 ) ;
200- expect ( onDateChanged ) . toHaveBeenNthCalledWith ( 2 , toMarkingFormat ( expectedDate ) , UpdateSources . ARROW_PRESS ) ;
201- expect ( onMonthChange ) . toHaveBeenNthCalledWith ( 2 , xdateToData ( expectedDate ) , UpdateSources . ARROW_PRESS ) ;
200+ expect ( onDateChanged ) . toHaveBeenNthCalledWith ( 2 , toMarkingFormat ( expectedDate ) , UpdateSources . PAGE_SCROLL ) ;
201+ expect ( onMonthChange ) . toHaveBeenNthCalledWith ( 2 , xdateToData ( expectedDate ) , UpdateSources . PAGE_SCROLL ) ;
202202 } ) ;
203203
204204 it ( `should navigate 6 months ahead and back successfully` , ( ) => {
@@ -209,13 +209,13 @@ describe('ExpandableCalendar', () => {
209209 } ) ;
210210 jest . runAllTimers ( ) ;
211211 const expectedFutureDate = today . clone ( ) . setDate ( 1 ) . addMonths ( 6 ) ;
212- expect ( onDateChanged ) . toHaveBeenNthCalledWith ( 6 , toMarkingFormat ( expectedFutureDate ) , UpdateSources . ARROW_PRESS ) ;
213- expect ( onMonthChange ) . toHaveBeenNthCalledWith ( 6 , xdateToData ( expectedFutureDate ) , UpdateSources . ARROW_PRESS ) ;
212+ expect ( onDateChanged ) . toHaveBeenNthCalledWith ( 6 , toMarkingFormat ( expectedFutureDate ) , UpdateSources . PAGE_SCROLL ) ;
213+ expect ( onMonthChange ) . toHaveBeenNthCalledWith ( 6 , xdateToData ( expectedFutureDate ) , UpdateSources . PAGE_SCROLL ) ;
214214 times ( 6 , ( ) => driver . pressOnHeaderArrow ( { left : true } ) ) ;
215215 jest . runAllTimers ( ) ;
216216 const expectedDate = today . clone ( ) . setDate ( 1 ) ;
217- expect ( onDateChanged ) . toHaveBeenNthCalledWith ( 12 , toMarkingFormat ( expectedDate ) , UpdateSources . ARROW_PRESS ) ;
218- expect ( onMonthChange ) . toHaveBeenNthCalledWith ( 12 , xdateToData ( expectedDate ) , UpdateSources . ARROW_PRESS ) ;
217+ expect ( onDateChanged ) . toHaveBeenNthCalledWith ( 12 , toMarkingFormat ( expectedDate ) , UpdateSources . PAGE_SCROLL ) ;
218+ expect ( onMonthChange ) . toHaveBeenNthCalledWith ( 12 , xdateToData ( expectedDate ) , UpdateSources . PAGE_SCROLL ) ;
219219 } ) ;
220220 } ) ;
221221 } ) ;
@@ -247,14 +247,14 @@ describe('ExpandableCalendar', () => {
247247 const currentDay = today . getDay ( ) ;
248248 const expectedDate = today . clone ( ) . addDays ( direction === Direction . LEFT ? - ( currentDay + 7 ) : ( 7 - currentDay ) ) ;
249249 driver . pressOnHeaderArrow ( { left : direction === Direction . LEFT } ) ;
250- expect ( onDateChanged ) . toHaveBeenCalledWith ( toMarkingFormat ( expectedDate ) , UpdateSources . WEEK_ARROW_PRESS ) ;
250+ expect ( onDateChanged ) . toHaveBeenCalledWith ( toMarkingFormat ( expectedDate ) , UpdateSources . PAGE_SCROLL ) ;
251251 } ) ;
252252
253253 it ( `should call onDateChanged for first day of initial week when changing to initial week` , ( ) => {
254254 driver . pressOnHeaderArrow ( { left : false } ) ;
255255 driver . pressOnHeaderArrow ( { left : true } ) ;
256256 const expectedDate = today . clone ( ) . addDays ( - ( today . getDay ( ) ) ) ;
257- expect ( onDateChanged ) . toHaveBeenNthCalledWith ( 2 , toMarkingFormat ( expectedDate ) , UpdateSources . WEEK_ARROW_PRESS ) ;
257+ expect ( onDateChanged ) . toHaveBeenNthCalledWith ( 2 , toMarkingFormat ( expectedDate ) , UpdateSources . PAGE_SCROLL ) ;
258258 } ) ;
259259
260260 it ( 'should fetch next weeks when in last week of the list' , ( ) => {
@@ -270,7 +270,7 @@ describe('ExpandableCalendar', () => {
270270 const diff = Math . ceil ( ( ( endOfMonth . getUTCDate ( ) + 1 ) - today . getUTCDate ( ) ) / 7 ) + ( ( today . getUTCDay ( ) > endOfMonth . getUTCDay ( ) ) ? 1 : 0 ) ;
271271 const expectedDate = today . clone ( ) . setDate ( today . getDate ( ) + 7 * diff - today . getDay ( ) ) ;
272272 times ( diff , ( ) => driver . pressOnHeaderArrow ( { left : false } ) ) ;
273- expect ( onMonthChange ) . toHaveBeenCalledWith ( xdateToData ( expectedDate ) , UpdateSources . WEEK_ARROW_PRESS ) ;
273+ expect ( onMonthChange ) . toHaveBeenCalledWith ( xdateToData ( expectedDate ) , UpdateSources . PAGE_SCROLL ) ;
274274 } ) ;
275275 } ) ;
276276 } ) ;
0 commit comments