@@ -99,12 +99,12 @@ describe('MatDatepicker', () => {
99
99
testComponent . touch = true ;
100
100
fixture . detectChanges ( ) ;
101
101
102
- expect ( document . querySelector ( '.mat-datepicker-dialog mat-dialog-container ' ) ) . toBeNull ( ) ;
102
+ expect ( document . querySelector ( '.mat-datepicker-dialog' ) ) . toBeNull ( ) ;
103
103
104
104
testComponent . datepicker . open ( ) ;
105
105
fixture . detectChanges ( ) ;
106
106
107
- expect ( document . querySelector ( '.mat-datepicker-dialog mat-dialog-container ' ) )
107
+ expect ( document . querySelector ( '.mat-datepicker-dialog' ) )
108
108
. not . toBeNull ( ) ;
109
109
} ) ;
110
110
@@ -149,13 +149,13 @@ describe('MatDatepicker', () => {
149
149
fixture . detectChanges ( ) ;
150
150
151
151
expect ( document . querySelector ( '.cdk-overlay-pane' ) ) . toBeNull ( ) ;
152
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
152
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
153
153
154
154
testComponent . datepicker . open ( ) ;
155
155
fixture . detectChanges ( ) ;
156
156
157
157
expect ( document . querySelector ( '.cdk-overlay-pane' ) ) . toBeNull ( ) ;
158
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
158
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
159
159
} ) ;
160
160
161
161
it ( 'disabled datepicker input should open the calendar if datepicker is enabled' , ( ) => {
@@ -218,13 +218,14 @@ describe('MatDatepicker', () => {
218
218
testComponent . datepicker . open ( ) ;
219
219
fixture . detectChanges ( ) ;
220
220
221
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . not . toBeNull ( ) ;
221
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . not . toBeNull ( ) ;
222
222
223
223
testComponent . datepicker . close ( ) ;
224
224
fixture . detectChanges ( ) ;
225
225
flush ( ) ;
226
+ fixture . detectChanges ( ) ;
226
227
227
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
228
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
228
229
} ) ) ;
229
230
230
231
it ( 'setting selected via click should update input and close calendar' , fakeAsync ( ( ) => {
@@ -235,15 +236,15 @@ describe('MatDatepicker', () => {
235
236
fixture . detectChanges ( ) ;
236
237
flush ( ) ;
237
238
238
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . not . toBeNull ( ) ;
239
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . not . toBeNull ( ) ;
239
240
expect ( testComponent . datepickerInput . value ) . toEqual ( new Date ( 2020 , JAN , 1 ) ) ;
240
241
241
242
let cells = document . querySelectorAll ( '.mat-calendar-body-cell' ) ;
242
243
dispatchMouseEvent ( cells [ 1 ] , 'click' ) ;
243
244
fixture . detectChanges ( ) ;
244
245
flush ( ) ;
245
246
246
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
247
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
247
248
expect ( testComponent . datepickerInput . value ) . toEqual ( new Date ( 2020 , JAN , 2 ) ) ;
248
249
} ) ) ;
249
250
@@ -256,7 +257,7 @@ describe('MatDatepicker', () => {
256
257
fixture . detectChanges ( ) ;
257
258
flush ( ) ;
258
259
259
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . not . toBeNull ( ) ;
260
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . not . toBeNull ( ) ;
260
261
expect ( testComponent . datepickerInput . value ) . toEqual ( new Date ( 2020 , JAN , 1 ) ) ;
261
262
262
263
let calendarBodyEl = document . querySelector ( '.mat-calendar-body' ) as HTMLElement ;
@@ -268,7 +269,7 @@ describe('MatDatepicker', () => {
268
269
fixture . detectChanges ( ) ;
269
270
flush ( ) ;
270
271
271
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
272
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
272
273
expect ( testComponent . datepickerInput . value ) . toEqual ( new Date ( 2020 , JAN , 2 ) ) ;
273
274
} ) ) ;
274
275
@@ -292,7 +293,7 @@ describe('MatDatepicker', () => {
292
293
}
293
294
294
295
expect ( selectedChangedSpy . calls . count ( ) ) . toEqual ( 1 ) ;
295
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
296
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
296
297
expect ( testComponent . datepickerInput . value ) . toEqual ( new Date ( 2020 , JAN , 2 ) ) ;
297
298
} ) ) ;
298
299
@@ -313,7 +314,7 @@ describe('MatDatepicker', () => {
313
314
314
315
fixture . whenStable ( ) . then ( ( ) => {
315
316
expect ( selectedChangedSpy . calls . count ( ) ) . toEqual ( 0 ) ;
316
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
317
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
317
318
expect ( testComponent . datepickerInput . value ) . toEqual ( new Date ( 2020 , JAN , 1 ) ) ;
318
319
} ) ;
319
320
} ) ;
@@ -903,13 +904,13 @@ describe('MatDatepicker', () => {
903
904
} ) ;
904
905
905
906
it ( 'should open calendar when toggle clicked' , ( ) => {
906
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
907
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
907
908
908
909
let toggle = fixture . debugElement . query ( By . css ( 'button' ) ) ;
909
910
dispatchMouseEvent ( toggle . nativeElement , 'click' ) ;
910
911
fixture . detectChanges ( ) ;
911
912
912
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . not . toBeNull ( ) ;
913
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . not . toBeNull ( ) ;
913
914
} ) ;
914
915
915
916
it ( 'should not open calendar when toggle clicked if datepicker is disabled' , ( ) => {
@@ -918,12 +919,12 @@ describe('MatDatepicker', () => {
918
919
const toggle = fixture . debugElement . query ( By . css ( 'button' ) ) . nativeElement ;
919
920
920
921
expect ( toggle . hasAttribute ( 'disabled' ) ) . toBe ( true ) ;
921
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
922
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
922
923
923
924
dispatchMouseEvent ( toggle , 'click' ) ;
924
925
fixture . detectChanges ( ) ;
925
926
926
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
927
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
927
928
} ) ;
928
929
929
930
it ( 'should not open calendar when toggle clicked if input is disabled' , ( ) => {
@@ -934,12 +935,12 @@ describe('MatDatepicker', () => {
934
935
const toggle = fixture . debugElement . query ( By . css ( 'button' ) ) . nativeElement ;
935
936
936
937
expect ( toggle . hasAttribute ( 'disabled' ) ) . toBe ( true ) ;
937
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
938
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
938
939
939
940
dispatchMouseEvent ( toggle , 'click' ) ;
940
941
fixture . detectChanges ( ) ;
941
942
942
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
943
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
943
944
} ) ;
944
945
945
946
it ( 'should set the `button` type on the trigger to prevent form submissions' , ( ) => {
@@ -1263,7 +1264,7 @@ describe('MatDatepicker', () => {
1263
1264
testComponent . datepicker . open ( ) ;
1264
1265
fixture . detectChanges ( ) ;
1265
1266
1266
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . not . toBeNull ( ) ;
1267
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . not . toBeNull ( ) ;
1267
1268
1268
1269
let cells = document . querySelectorAll ( '.mat-calendar-body-cell' ) ;
1269
1270
expect ( cells [ 0 ] . classList ) . toContain ( 'mat-calendar-body-disabled' ) ;
@@ -1335,7 +1336,7 @@ describe('MatDatepicker', () => {
1335
1336
testComponent . datepicker . open ( ) ;
1336
1337
fixture . detectChanges ( ) ;
1337
1338
1338
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . not . toBeNull ( ) ;
1339
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . not . toBeNull ( ) ;
1339
1340
1340
1341
const cells = document . querySelectorAll ( '.mat-calendar-body-cell' ) ;
1341
1342
dispatchMouseEvent ( cells [ 0 ] , 'click' ) ;
0 commit comments