javascript - Check that inner function is called on ng-click -


i have following ng-click function within angular controller:

vm.slidetoggle = function(index) {   var details = (angular.element('#a' + vm.accounts[index].id));   details.slidetoggle(); }; 

i'm attempting test details.slidetoggle() called when vm.slidetoggle called through following spec. issue lies how access details.slidetoggle properly:

it('should slide in more info when clicked', function() {   expect(infocontroller.slidetoggle).tobedefined();   infocontroller.slidetoggle(0);   expect(infocontroller.slidetoggle).tohavebeencalled();   expect(infocontroller.slidetoggle.call.length).toequal(1);   expect(details.slidetoggle).tohavebeencalled(); }); 


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -