This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
Expand file tree Collapse file tree 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'])
302302 openedClasses . remove ( modalBodyClass , modalInstance ) ;
303303 appendToElement . toggleClass ( modalBodyClass , openedClasses . hasKey ( modalBodyClass ) ) ;
304304 toggleTopWindowClass ( true ) ;
305- } ) ;
305+ } , modalWindow . closedDeferred ) ;
306306 checkRemoveBackdrop ( ) ;
307307
308308 //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() {
480480
481481 it ( 'should resolve the closed promise when modal is closed' , function ( ) {
482482 var modal = open ( { template : '<div>Content</div>' } ) ;
483+ var closed = false ;
483484 close ( modal , 'closed ok' ) ;
484485
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 ) ;
486493 } ) ;
487494
488495 it ( 'should resolve the closed promise when modal is dismissed' , function ( ) {
489496 var modal = open ( { template : '<div>Content</div>' } ) ;
497+ var closed = false ;
490498 dismiss ( modal , 'esc' ) ;
491499
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 ) ;
493507 } ) ;
494508
495509 it ( 'should expose a promise linked to the templateUrl / resolve promises' , function ( ) {
You can’t perform that action at this time.
0 commit comments