Files
ionic-framework/js/ext/angular/test/directive/ionicNavClear.unit.js
2014-04-07 10:31:38 -06:00

18 lines
678 B
JavaScript

describe('navClear directive', function() {
beforeEach(module('ionic'));
it('should call nextViewOptions on click & stateChangeSuccess', inject(function($rootScope, $compile, $ionicViewService) {
spyOn($ionicViewService, 'nextViewOptions');
var el = $compile('<div nav-clear>')($rootScope.$new());
expect($ionicViewService.nextViewOptions).not.toHaveBeenCalled();
el.triggerHandler('click');
el.scope().$broadcast('$stateChangeStart');
expect($ionicViewService.nextViewOptions).toHaveBeenCalled();
expect($ionicViewService.nextViewOptions.mostRecentCall.args[0]).toEqual({
disableAnimate: true,
disableBack: true
});
}));
});