@@ -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' , ( ) => {
@@ -217,13 +217,14 @@ describe('MatDatepicker', () => {
217
217
testComponent . datepicker . open ( ) ;
218
218
fixture . detectChanges ( ) ;
219
219
220
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . not . toBeNull ( ) ;
220
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . not . toBeNull ( ) ;
221
221
222
222
testComponent . datepicker . close ( ) ;
223
223
fixture . detectChanges ( ) ;
224
224
flush ( ) ;
225
+ fixture . detectChanges ( ) ;
225
226
226
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
227
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
227
228
} ) ) ;
228
229
229
230
it ( 'setting selected via click should update input and close calendar' , fakeAsync ( ( ) => {
@@ -234,15 +235,15 @@ describe('MatDatepicker', () => {
234
235
fixture . detectChanges ( ) ;
235
236
flush ( ) ;
236
237
237
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . not . toBeNull ( ) ;
238
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . not . toBeNull ( ) ;
238
239
expect ( testComponent . datepickerInput . value ) . toEqual ( new Date ( 2020 , JAN , 1 ) ) ;
239
240
240
241
let cells = document . querySelectorAll ( '.mat-calendar-body-cell' ) ;
241
242
dispatchMouseEvent ( cells [ 1 ] , 'click' ) ;
242
243
fixture . detectChanges ( ) ;
243
244
flush ( ) ;
244
245
245
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
246
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
246
247
expect ( testComponent . datepickerInput . value ) . toEqual ( new Date ( 2020 , JAN , 2 ) ) ;
247
248
} ) ) ;
248
249
@@ -255,7 +256,7 @@ describe('MatDatepicker', () => {
255
256
fixture . detectChanges ( ) ;
256
257
flush ( ) ;
257
258
258
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . not . toBeNull ( ) ;
259
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . not . toBeNull ( ) ;
259
260
expect ( testComponent . datepickerInput . value ) . toEqual ( new Date ( 2020 , JAN , 1 ) ) ;
260
261
261
262
let calendarBodyEl = document . querySelector ( '.mat-calendar-body' ) as HTMLElement ;
@@ -267,7 +268,7 @@ describe('MatDatepicker', () => {
267
268
fixture . detectChanges ( ) ;
268
269
flush ( ) ;
269
270
270
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
271
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
271
272
expect ( testComponent . datepickerInput . value ) . toEqual ( new Date ( 2020 , JAN , 2 ) ) ;
272
273
} ) ) ;
273
274
@@ -291,7 +292,7 @@ describe('MatDatepicker', () => {
291
292
}
292
293
293
294
expect ( selectedChangedSpy . calls . count ( ) ) . toEqual ( 1 ) ;
294
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
295
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
295
296
expect ( testComponent . datepickerInput . value ) . toEqual ( new Date ( 2020 , JAN , 2 ) ) ;
296
297
} ) ) ;
297
298
@@ -312,7 +313,7 @@ describe('MatDatepicker', () => {
312
313
313
314
fixture . whenStable ( ) . then ( ( ) => {
314
315
expect ( selectedChangedSpy . calls . count ( ) ) . toEqual ( 0 ) ;
315
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
316
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
316
317
expect ( testComponent . datepickerInput . value ) . toEqual ( new Date ( 2020 , JAN , 1 ) ) ;
317
318
} ) ;
318
319
} ) ;
@@ -902,13 +903,13 @@ describe('MatDatepicker', () => {
902
903
} ) ;
903
904
904
905
it ( 'should open calendar when toggle clicked' , ( ) => {
905
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
906
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
906
907
907
908
let toggle = fixture . debugElement . query ( By . css ( 'button' ) ) ;
908
909
dispatchMouseEvent ( toggle . nativeElement , 'click' ) ;
909
910
fixture . detectChanges ( ) ;
910
911
911
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . not . toBeNull ( ) ;
912
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . not . toBeNull ( ) ;
912
913
} ) ;
913
914
914
915
it ( 'should not open calendar when toggle clicked if datepicker is disabled' , ( ) => {
@@ -917,12 +918,12 @@ describe('MatDatepicker', () => {
917
918
const toggle = fixture . debugElement . query ( By . css ( 'button' ) ) . nativeElement ;
918
919
919
920
expect ( toggle . hasAttribute ( 'disabled' ) ) . toBe ( true ) ;
920
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
921
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
921
922
922
923
dispatchMouseEvent ( toggle , 'click' ) ;
923
924
fixture . detectChanges ( ) ;
924
925
925
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
926
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
926
927
} ) ;
927
928
928
929
it ( 'should not open calendar when toggle clicked if input is disabled' , ( ) => {
@@ -933,12 +934,12 @@ describe('MatDatepicker', () => {
933
934
const toggle = fixture . debugElement . query ( By . css ( 'button' ) ) . nativeElement ;
934
935
935
936
expect ( toggle . hasAttribute ( 'disabled' ) ) . toBe ( true ) ;
936
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
937
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
937
938
938
939
dispatchMouseEvent ( toggle , 'click' ) ;
939
940
fixture . detectChanges ( ) ;
940
941
941
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . toBeNull ( ) ;
942
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . toBeNull ( ) ;
942
943
} ) ;
943
944
944
945
it ( 'should set the `button` type on the trigger to prevent form submissions' , ( ) => {
@@ -1232,7 +1233,7 @@ describe('MatDatepicker', () => {
1232
1233
testComponent . datepicker . open ( ) ;
1233
1234
fixture . detectChanges ( ) ;
1234
1235
1235
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . not . toBeNull ( ) ;
1236
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . not . toBeNull ( ) ;
1236
1237
1237
1238
let cells = document . querySelectorAll ( '.mat-calendar-body-cell' ) ;
1238
1239
expect ( cells [ 0 ] . classList ) . toContain ( 'mat-calendar-body-disabled' ) ;
@@ -1304,7 +1305,7 @@ describe('MatDatepicker', () => {
1304
1305
testComponent . datepicker . open ( ) ;
1305
1306
fixture . detectChanges ( ) ;
1306
1307
1307
- expect ( document . querySelector ( 'mat-dialog-container ' ) ) . not . toBeNull ( ) ;
1308
+ expect ( document . querySelector ( '. mat-datepicker-dialog ' ) ) . not . toBeNull ( ) ;
1308
1309
1309
1310
const cells = document . querySelectorAll ( '.mat-calendar-body-cell' ) ;
1310
1311
dispatchMouseEvent ( cells [ 0 ] , 'click' ) ;
0 commit comments