@@ -40,6 +40,7 @@ import {
40
40
inject ,
41
41
TestBed ,
42
42
tick ,
43
+ waitForAsync ,
43
44
} from '@angular/core/testing' ;
44
45
import { By } from '@angular/platform-browser' ;
45
46
import { BrowserAnimationsModule , NoopAnimationsModule } from '@angular/platform-browser/animations' ;
@@ -965,7 +966,8 @@ describe('MDC-based MatDialog', () => {
965
966
dialog . open ( PizzaMsg , { disableClose : true , viewContainerRef : testViewContainerRef } ) ;
966
967
967
968
viewContainerFixture . detectChanges ( ) ;
968
- flushMicrotasks ( ) ;
969
+ flush ( ) ;
970
+ viewContainerFixture . detectChanges ( ) ;
969
971
970
972
let backdrop = overlayContainerElement . querySelector ( '.cdk-overlay-backdrop' ) as HTMLElement ;
971
973
let input = overlayContainerElement . querySelector ( 'input' ) as HTMLInputElement ;
@@ -994,7 +996,8 @@ describe('MDC-based MatDialog', () => {
994
996
} ) ;
995
997
996
998
viewContainerFixture . detectChanges ( ) ;
997
- flushMicrotasks ( ) ;
999
+ flush ( ) ;
1000
+ viewContainerFixture . detectChanges ( ) ;
998
1001
999
1002
let backdrop = overlayContainerElement . querySelector (
1000
1003
'.cdk-overlay-backdrop' ,
@@ -1179,7 +1182,8 @@ describe('MDC-based MatDialog', () => {
1179
1182
dialog . open ( PizzaMsg , { viewContainerRef : testViewContainerRef } ) ;
1180
1183
1181
1184
viewContainerFixture . detectChanges ( ) ;
1182
- flushMicrotasks ( ) ;
1185
+ flush ( ) ;
1186
+ viewContainerFixture . detectChanges ( ) ;
1183
1187
1184
1188
expect ( document . activeElement ! . tagName )
1185
1189
. withContext ( 'Expected first tabbable element (input) in the dialog to be focused.' )
@@ -1505,7 +1509,8 @@ describe('MDC-based MatDialog', () => {
1505
1509
dialog . open ( DialogWithoutFocusableElements ) ;
1506
1510
1507
1511
viewContainerFixture . detectChanges ( ) ;
1508
- flushMicrotasks ( ) ;
1512
+ flush ( ) ;
1513
+ viewContainerFixture . detectChanges ( ) ;
1509
1514
1510
1515
expect ( document . activeElement ! . tagName )
1511
1516
. withContext ( 'Expected dialog container to be focused.' )
0 commit comments