mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
amend($ionicModal): if hardwareBackButtonClose false, back button is noop
Addresses #1397
This commit is contained in:
0
test/unit/angular/directive/gestures.js
vendored
Normal file
0
test/unit/angular/directive/gestures.js
vendored
Normal file
@@ -106,10 +106,14 @@ describe('Ionic Modal', function() {
|
||||
var instance = modal.fromTemplate(template, {
|
||||
hardwareBackButtonClose: false
|
||||
});
|
||||
spyOn($ionicPlatform, 'registerBackButtonAction');
|
||||
spyOn($ionicPlatform, 'registerBackButtonAction').andCallThrough();
|
||||
instance.show();
|
||||
timeout.flush();
|
||||
expect($ionicPlatform.registerBackButtonAction).not.toHaveBeenCalled();
|
||||
expect($ionicPlatform.registerBackButtonAction).toHaveBeenCalledWith(jasmine.any(Function), PLATFORM_BACK_BUTTON_PRIORITY_MODAL);
|
||||
|
||||
ionicPlatform.hardwareBackButtonClick();
|
||||
|
||||
expect(instance.isShown()).toBe(true);
|
||||
}));
|
||||
|
||||
it('should call _deregisterBackButton on hide', function() {
|
||||
|
||||
Reference in New Issue
Block a user