mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat($ionicActionSheet): add cancelOnStateChange option, default true
Closes #1318 BREAKING CHANGE: $ionicActionSheet's default behavior is now to cancel when the app's state changes. To disable this behavior, pass `cancelOnStateChange: false` into $ionicActionSheet.show().
This commit is contained in:
@@ -84,4 +84,20 @@ describe('Ionic ActionSheet Service', function() {
|
||||
expect(cancelSpy).toHaveBeenCalled();
|
||||
}));
|
||||
|
||||
it('should cancelOnStateChange by default', inject(function($rootScope) {
|
||||
var scope = setup();
|
||||
spyOn(scope, 'cancel');
|
||||
$rootScope.$broadcast('$stateChangeSuccess');
|
||||
expect(scope.cancel).toHaveBeenCalled();
|
||||
}));
|
||||
|
||||
it('should not cancelOnStateChange with option as false', inject(function($rootScope) {
|
||||
var scope = setup({
|
||||
cancelOnStateChange: false
|
||||
});
|
||||
spyOn(scope, 'cancel');
|
||||
$rootScope.$broadcast('$stateChangeSuccess');
|
||||
expect(scope.cancel).not.toHaveBeenCalled();
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user