I'm working on an Angular app that uses Angular UI-Router for routing and maintaining state. I am having a hard time getting my unit test to even compile. It seems that no matter what I do, I keep getting the following error:
Error: State '' is not navigable
I have the following states set up in my app, as well as the following redirects:
app.config(function($stateProvider, $urlRouterProvider) {
var paramList = '?beds&lat&lon&zoom';
$urlRouterProvider
.when('', '/')
.when('/', '/search')
.when('/search', '/search/list')
.otherwise('');
$stateProvider
.state('search', {
abstract: true,
url: '/search',
templateUrl: 'views/search.html',
controller: 'SearchCtrl'
})
.state('search.list', {
url: '/list' + paramList,
templateUrl: 'views/search-list.html'
})
.state('search.map', {
url: '/map' + paramList,
templateUrl: 'views/search-map.html'
})
.state('search.listing', {
url: '/listing/:id' + paramList,
templateUrl: 'views/search-listing.html'
})
.state('favorites', {
url: '/favorites',
templateUrl: 'views/favorites.html'
})
});
I've eaten up an entire day trying to get a single test to work, but no matter what approach I take, I always end up at this same error. I have an e2e test running just fine.