@@ -61,22 +61,22 @@ describe('MatCalendar', () => {
61
61
} ) ;
62
62
63
63
it ( 'should be in month view with specified month active' , ( ) => {
64
- expect ( calendarInstance . _currentView ) . toBe ( 'month' ) ;
64
+ expect ( calendarInstance . currentView ) . toBe ( 'month' ) ;
65
65
expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , JAN , 31 ) ) ;
66
66
} ) ;
67
67
68
68
it ( 'should toggle view when period clicked' , ( ) => {
69
- expect ( calendarInstance . _currentView ) . toBe ( 'month' ) ;
69
+ expect ( calendarInstance . currentView ) . toBe ( 'month' ) ;
70
70
71
71
periodButton . click ( ) ;
72
72
fixture . detectChanges ( ) ;
73
73
74
- expect ( calendarInstance . _currentView ) . toBe ( 'multi-year' ) ;
74
+ expect ( calendarInstance . currentView ) . toBe ( 'multi-year' ) ;
75
75
76
76
periodButton . click ( ) ;
77
77
fixture . detectChanges ( ) ;
78
78
79
- expect ( calendarInstance . _currentView ) . toBe ( 'month' ) ;
79
+ expect ( calendarInstance . currentView ) . toBe ( 'month' ) ;
80
80
} ) ;
81
81
82
82
it ( 'should go to next and previous month' , ( ) => {
@@ -97,13 +97,13 @@ describe('MatCalendar', () => {
97
97
periodButton . click ( ) ;
98
98
fixture . detectChanges ( ) ;
99
99
100
- expect ( calendarInstance . _currentView ) . toBe ( 'multi-year' ) ;
100
+ expect ( calendarInstance . currentView ) . toBe ( 'multi-year' ) ;
101
101
expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , JAN , 31 ) ) ;
102
102
103
103
( calendarElement . querySelector ( '.mat-calendar-body-active' ) as HTMLElement ) . click ( ) ;
104
104
fixture . detectChanges ( ) ;
105
105
106
- expect ( calendarInstance . _currentView ) . toBe ( 'year' ) ;
106
+ expect ( calendarInstance . currentView ) . toBe ( 'year' ) ;
107
107
108
108
nextButton . click ( ) ;
109
109
fixture . detectChanges ( ) ;
@@ -120,7 +120,7 @@ describe('MatCalendar', () => {
120
120
periodButton . click ( ) ;
121
121
fixture . detectChanges ( ) ;
122
122
123
- expect ( calendarInstance . _currentView ) . toBe ( 'multi-year' ) ;
123
+ expect ( calendarInstance . currentView ) . toBe ( 'multi-year' ) ;
124
124
expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , JAN , 31 ) ) ;
125
125
126
126
nextButton . click ( ) ;
@@ -138,21 +138,21 @@ describe('MatCalendar', () => {
138
138
periodButton . click ( ) ;
139
139
fixture . detectChanges ( ) ;
140
140
141
- expect ( calendarInstance . _currentView ) . toBe ( 'multi-year' ) ;
141
+ expect ( calendarInstance . currentView ) . toBe ( 'multi-year' ) ;
142
142
expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , JAN , 31 ) ) ;
143
143
144
144
let yearCells = calendarElement . querySelectorAll ( '.mat-calendar-body-cell' ) ;
145
145
( yearCells [ 0 ] as HTMLElement ) . click ( ) ;
146
146
fixture . detectChanges ( ) ;
147
147
148
- expect ( calendarInstance . _currentView ) . toBe ( 'year' ) ;
148
+ expect ( calendarInstance . currentView ) . toBe ( 'year' ) ;
149
149
expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2016 , JAN , 31 ) ) ;
150
150
151
151
let monthCells = calendarElement . querySelectorAll ( '.mat-calendar-body-cell' ) ;
152
152
( monthCells [ monthCells . length - 1 ] as HTMLElement ) . click ( ) ;
153
153
fixture . detectChanges ( ) ;
154
154
155
- expect ( calendarInstance . _currentView ) . toBe ( 'month' ) ;
155
+ expect ( calendarInstance . currentView ) . toBe ( 'month' ) ;
156
156
expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2016 , DEC , 31 ) ) ;
157
157
expect ( testComponent . selected ) . toBeFalsy ( 'no date should be selected yet' ) ;
158
158
} ) ;
@@ -162,22 +162,22 @@ describe('MatCalendar', () => {
162
162
( monthCells [ monthCells . length - 1 ] as HTMLElement ) . click ( ) ;
163
163
fixture . detectChanges ( ) ;
164
164
165
- expect ( calendarInstance . _currentView ) . toBe ( 'month' ) ;
165
+ expect ( calendarInstance . currentView ) . toBe ( 'month' ) ;
166
166
expect ( testComponent . selected ) . toEqual ( new Date ( 2017 , JAN , 31 ) ) ;
167
167
} ) ;
168
168
169
169
it ( 'should emit the selected month on cell clicked in year view' , ( ) => {
170
170
periodButton . click ( ) ;
171
171
fixture . detectChanges ( ) ;
172
172
173
- expect ( calendarInstance . _currentView ) . toBe ( 'multi-year' ) ;
173
+ expect ( calendarInstance . currentView ) . toBe ( 'multi-year' ) ;
174
174
expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , JAN , 31 ) ) ;
175
175
176
176
( calendarElement . querySelector ( '.mat-calendar-body-active' ) as HTMLElement ) . click ( ) ;
177
177
178
178
fixture . detectChanges ( ) ;
179
179
180
- expect ( calendarInstance . _currentView ) . toBe ( 'year' ) ;
180
+ expect ( calendarInstance . currentView ) . toBe ( 'year' ) ;
181
181
182
182
( calendarElement . querySelector ( '.mat-calendar-body-active' ) as HTMLElement ) . click ( ) ;
183
183
@@ -189,7 +189,7 @@ describe('MatCalendar', () => {
189
189
periodButton . click ( ) ;
190
190
fixture . detectChanges ( ) ;
191
191
192
- expect ( calendarInstance . _currentView ) . toBe ( 'multi-year' ) ;
192
+ expect ( calendarInstance . currentView ) . toBe ( 'multi-year' ) ;
193
193
expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , JAN , 31 ) ) ;
194
194
195
195
( calendarElement . querySelector ( '.mat-calendar-body-active' ) as HTMLElement ) . click ( ) ;
@@ -239,12 +239,12 @@ describe('MatCalendar', () => {
239
239
dispatchMouseEvent ( periodButton , 'click' ) ;
240
240
fixture . detectChanges ( ) ;
241
241
242
- expect ( calendarInstance . _currentView ) . toBe ( 'multi-year' ) ;
242
+ expect ( calendarInstance . currentView ) . toBe ( 'multi-year' ) ;
243
243
244
244
( calendarBodyEl . querySelector ( '.mat-calendar-body-active' ) as HTMLElement ) . click ( ) ;
245
245
fixture . detectChanges ( ) ;
246
246
247
- expect ( calendarInstance . _currentView ) . toBe ( 'year' ) ;
247
+ expect ( calendarInstance . currentView ) . toBe ( 'year' ) ;
248
248
} ) ;
249
249
250
250
it ( 'should return to month view on enter' , ( ) => {
@@ -256,7 +256,7 @@ describe('MatCalendar', () => {
256
256
dispatchKeyboardEvent ( tableBodyEl , 'keydown' , ENTER ) ;
257
257
fixture . detectChanges ( ) ;
258
258
259
- expect ( calendarInstance . _currentView ) . toBe ( 'month' ) ;
259
+ expect ( calendarInstance . currentView ) . toBe ( 'month' ) ;
260
260
expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , FEB , 28 ) ) ;
261
261
expect ( testComponent . selected ) . toBeUndefined ( ) ;
262
262
} ) ;
@@ -267,7 +267,7 @@ describe('MatCalendar', () => {
267
267
dispatchMouseEvent ( periodButton , 'click' ) ;
268
268
fixture . detectChanges ( ) ;
269
269
270
- expect ( calendarInstance . _currentView ) . toBe ( 'multi-year' ) ;
270
+ expect ( calendarInstance . currentView ) . toBe ( 'multi-year' ) ;
271
271
} ) ;
272
272
273
273
it ( 'should go to year view on enter' , ( ) => {
@@ -279,7 +279,7 @@ describe('MatCalendar', () => {
279
279
dispatchKeyboardEvent ( tableBodyEl , 'keydown' , ENTER ) ;
280
280
fixture . detectChanges ( ) ;
281
281
282
- expect ( calendarInstance . _currentView ) . toBe ( 'year' ) ;
282
+ expect ( calendarInstance . currentView ) . toBe ( 'year' ) ;
283
283
expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2018 , JAN , 31 ) ) ;
284
284
expect ( testComponent . selected ) . toBeUndefined ( ) ;
285
285
} ) ;
@@ -491,7 +491,7 @@ describe('MatCalendar', () => {
491
491
} ) ;
492
492
493
493
it ( 'should not allow selection of disabled date in month view' , ( ) => {
494
- expect ( calendarInstance . _currentView ) . toBe ( 'month' ) ;
494
+ expect ( calendarInstance . currentView ) . toBe ( 'month' ) ;
495
495
expect ( calendarInstance . _activeDate ) . toEqual ( new Date ( 2017 , JAN , 1 ) ) ;
496
496
497
497
dispatchKeyboardEvent ( tableBodyEl , 'keydown' , ENTER ) ;
@@ -512,13 +512,13 @@ describe('MatCalendar', () => {
512
512
calendarInstance . _activeDate = new Date ( 2017 , NOV , 1 ) ;
513
513
fixture . detectChanges ( ) ;
514
514
515
- expect ( calendarInstance . _currentView ) . toBe ( 'year' ) ;
515
+ expect ( calendarInstance . currentView ) . toBe ( 'year' ) ;
516
516
517
517
tableBodyEl = calendarElement . querySelector ( '.mat-calendar-body' ) as HTMLElement ;
518
518
dispatchKeyboardEvent ( tableBodyEl , 'keydown' , ENTER ) ;
519
519
fixture . detectChanges ( ) ;
520
520
521
- expect ( calendarInstance . _currentView ) . toBe ( 'month' ) ;
521
+ expect ( calendarInstance . currentView ) . toBe ( 'month' ) ;
522
522
expect ( testComponent . selected ) . toBeUndefined ( ) ;
523
523
} ) ;
524
524
} ) ;
0 commit comments