/**
* Created by Michael on 02/04/14.
*/
describe('uiBreadcrumbs directive', function() {
var $compile;
var $scope;
var element;
var $state;
beforeEach(module('angularUtils.directives.uiBreadcrumbs'));
beforeEach(module('templates-main'));
beforeEach(function() {
var mockModule = angular.module('mockModule', function() {})
.config(function($stateProvider) {
$stateProvider
.state('root', {
url: '/',
data: {
displayName: 'Home'
},
custom: {
alternateDisplayName: 'Other Home'
}
})
.state('root.section', {
url: 'section/',
data: {
displayName: 'Section 1'
}
})
.state('root.section.subsection', {
url: 'subsection/',
data: {
displayName: 'Subsection'
}
})
.state('root.section.subsection.nobreadcrumb', {
url: 'subsection/bit',
data: {
displayName: false
}
})
.state('async1', {
url: 'aync1/',
data: {
displayName: 'Async Route 1'
},
resolve:{
simpleProperty: function() {
return 'hello';
}
}
})
.state('async2', {
url: 'async2/',
data: {
displayName: '{{ resolvedName | uppercase }}'
},
resolve:{
resolvedName: function(){
return "A Good Route";
}
}
})
.state( 'root.abstract', {
abstract: true,
url: 'abstract/',
data: {
breadcrumbProxy: 'abstract.child'
}
})
.state( 'root.abstract.child', {
url: 'list/',
data: {
displayName: 'Concrete'
}
})
.state( 'root.things', {
abstract: true,
url: 'things/',
data: {
breadcrumbProxy: 'root.things.list'
}
})
.state( 'root.things.list', {
url: 'all/',
data: {
displayName: 'Things'
}
})
.state( 'root.things.detail', {
url: 'detail/',
data: {
displayName: 'A Thing'
}
});
});
module('mockModule');
// Kickstart the injectors previously registered with calls to angular.mock.module
inject(function () {});
});
beforeEach(inject(function($rootScope, _$compile_, _$state_) {
$compile = _$compile_;
$scope = $rootScope.$new();
$state = _$state_;
element = $compile('