This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree 2 files changed +17
-3
lines changed
2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap'])
302
302
openedClasses . remove ( modalBodyClass , modalInstance ) ;
303
303
appendToElement . toggleClass ( modalBodyClass , openedClasses . hasKey ( modalBodyClass ) ) ;
304
304
toggleTopWindowClass ( true ) ;
305
- } ) ;
305
+ } , modalWindow . closedDeferred ) ;
306
306
checkRemoveBackdrop ( ) ;
307
307
308
308
//move focus to specified element if available, or else to body
Original file line number Diff line number Diff line change @@ -480,16 +480,30 @@ describe('$uibModal', function() {
480
480
481
481
it ( 'should resolve the closed promise when modal is closed' , function ( ) {
482
482
var modal = open ( { template : '<div>Content</div>' } ) ;
483
+ var closed = false ;
483
484
close ( modal , 'closed ok' ) ;
484
485
485
- expect ( modal . closed ) . toBeResolvedWith ( undefined ) ;
486
+ modal . closed . then ( function ( ) {
487
+ closed = true ;
488
+ } ) ;
489
+
490
+ $rootScope . $digest ( ) ;
491
+
492
+ expect ( closed ) . toBe ( true ) ;
486
493
} ) ;
487
494
488
495
it ( 'should resolve the closed promise when modal is dismissed' , function ( ) {
489
496
var modal = open ( { template : '<div>Content</div>' } ) ;
497
+ var closed = false ;
490
498
dismiss ( modal , 'esc' ) ;
491
499
492
- expect ( modal . closed ) . toBeResolvedWith ( undefined ) ;
500
+ modal . closed . then ( function ( ) {
501
+ closed = true ;
502
+ } ) ;
503
+
504
+ $rootScope . $digest ( ) ;
505
+
506
+ expect ( closed ) . toBe ( true ) ;
493
507
} ) ;
494
508
495
509
it ( 'should expose a promise linked to the templateUrl / resolve promises' , function ( ) {
You can’t perform that action at this time.
0 commit comments