@@ -20,9 +20,10 @@ import {
20
20
JUL ,
21
21
JUN ,
22
22
MAR ,
23
- MAY ,
24
23
MatNativeDateModule ,
24
+ MAY ,
25
25
NOV ,
26
+ OCT ,
26
27
SEP ,
27
28
} from '@angular/material/core' ;
28
29
import { By } from '@angular/platform-browser' ;
@@ -341,46 +342,46 @@ describe('MatCalendar', () => {
341
342
dispatchKeyboardEvent ( calendarBodyEl , 'keydown' , UP_ARROW ) ;
342
343
fixture . detectChanges ( ) ;
343
344
344
- expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2016 , AUG , 31 ) ) ;
345
+ expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2016 , SEP , 30 ) ) ;
345
346
346
347
calendarInstance . _activeDate = new Date ( 2017 , JUL , 1 ) ;
347
348
fixture . detectChanges ( ) ;
348
349
349
350
dispatchKeyboardEvent ( calendarBodyEl , 'keydown' , UP_ARROW ) ;
350
351
fixture . detectChanges ( ) ;
351
352
352
- expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2016 , JUL , 1 ) ) ;
353
+ expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , MAR , 1 ) ) ;
353
354
354
355
calendarInstance . _activeDate = new Date ( 2017 , DEC , 10 ) ;
355
356
fixture . detectChanges ( ) ;
356
357
357
358
dispatchKeyboardEvent ( calendarBodyEl , 'keydown' , UP_ARROW ) ;
358
359
fixture . detectChanges ( ) ;
359
360
360
- expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , MAY , 10 ) ) ;
361
+ expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , AUG , 10 ) ) ;
361
362
} ) ;
362
363
363
364
it ( 'should go down a row on down arrow press' , ( ) => {
364
365
dispatchKeyboardEvent ( calendarBodyEl , 'keydown' , DOWN_ARROW ) ;
365
366
fixture . detectChanges ( ) ;
366
367
367
- expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , AUG , 31 ) ) ;
368
+ expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , MAY , 31 ) ) ;
368
369
369
370
calendarInstance . _activeDate = new Date ( 2017 , JUN , 1 ) ;
370
371
fixture . detectChanges ( ) ;
371
372
372
373
dispatchKeyboardEvent ( calendarBodyEl , 'keydown' , DOWN_ARROW ) ;
373
374
fixture . detectChanges ( ) ;
374
375
375
- expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2018 , JUN , 1 ) ) ;
376
+ expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , OCT , 1 ) ) ;
376
377
377
378
calendarInstance . _activeDate = new Date ( 2017 , SEP , 30 ) ;
378
379
fixture . detectChanges ( ) ;
379
380
380
381
dispatchKeyboardEvent ( calendarBodyEl , 'keydown' , DOWN_ARROW ) ;
381
382
fixture . detectChanges ( ) ;
382
383
383
- expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2018 , FEB , 28 ) ) ;
384
+ expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2018 , JAN , 30 ) ) ;
384
385
} ) ;
385
386
386
387
it ( 'should go to first month of the year on home press' , ( ) => {
0 commit comments