File tree 1 file changed +14
-5
lines changed
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ describe('MdDialog', () => {
163
163
} ) ) . toBe ( ref ) ;
164
164
} ) ;
165
165
166
- it ( 'should notify the observers if all open dialogs have finished closing' , ( ) => {
166
+ it ( 'should notify the observers if all open dialogs have finished closing' , async ( ( ) => {
167
167
const ref1 = dialog . open ( PizzaMsg , {
168
168
viewContainerRef : testViewContainerRef
169
169
} ) ;
@@ -177,10 +177,19 @@ describe('MdDialog', () => {
177
177
} ) ;
178
178
179
179
ref1 . close ( ) ;
180
- expect ( allClosed ) . toBeFalsy ( ) ;
181
- ref2 . close ( ) ;
182
- expect ( allClosed ) . toBeTruthy ( ) ;
183
- } ) ;
180
+ viewContainerFixture . detectChanges ( ) ;
181
+
182
+ viewContainerFixture . whenStable ( ) . then ( ( ) => {
183
+ expect ( allClosed ) . toBeFalsy ( ) ;
184
+
185
+ ref2 . close ( ) ;
186
+ viewContainerFixture . detectChanges ( ) ;
187
+
188
+ viewContainerFixture . whenStable ( ) . then ( ( ) => {
189
+ expect ( allClosed ) . toBeTruthy ( ) ;
190
+ } ) ;
191
+ } ) ;
192
+ } ) ) ;
184
193
185
194
it ( 'should should override the width of the overlay pane' , ( ) => {
186
195
dialog . open ( PizzaMsg , {
You can’t perform that action at this time.
0 commit comments