I am trying to test my router functionality .I am getting this error Cannot read property 'href' of undefined ..could you please tell me how i will remove this error
here is my code http://plnkr.co/edit/mZiNteMWqS4forycMHiK?p=preview
describe('router check', function(){
describe('router check',function(){
var view = 'partials/state1.html',
$state;
var $scope;
beforeEach(function(){
module('app');
});
beforeEach(inject(function($rootScope,$templateCache,$state) {
$state=$state;
$templateCache.put(view, '');
}));
it('should map state state1 to url /state1 ', function() {
expect($state.href('state1', {})).to.equal('/state1');
});
it('should map /state1 route to state1 View template', function () {
expect($state.get('state1').templateUrl).to.equal(view);
});
})