AngularJS ui-router: Test ui-sref
问题 I'm trying to test some views, that are using <a ui-sref='someState'>link</a> to link to other states in my application. In my tests I'm triggering a click on this elements like this: element.find('a').click() How do I test, if the state is switched to someState ? It would be easy, when using $state in my controller like this: // in my view <a ng-click="goTo('someState')">link</a> // in my controller $scope.goTo = function(s) { $state.go(s) }; // in my tests spyOn($state, 'go'); element.find(