amend($ionicModal): if hardwareBackButtonClose false, back button is noop

Addresses #1397
This commit is contained in:
Andrew Joslin
2014-06-05 07:28:28 -06:00
parent 53af788da9
commit 9942045fb2
3 changed files with 10 additions and 8 deletions

View File

View 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() {