Files
ionic-framework/test/unit/angular/directive/navClear.unit.js
2014-04-14 10:47:27 -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
});
}));
});