mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-06-14 17:39:04 +08:00
Since the structure was a little different than the prototype, classes/styles where not applied correctly to the links in the left sidenav. This commit fixes the issue. I also added FontAwesome, in order to be able to display icons until the Material Design icon-font is released. Since this is a temporary meassure, I didn't added as a bower dependency; just added a `font-awesome` folder in assets and added `font-awesome/css/font-awesome.css` to the stylesheets of each deployment (under `docs/config/services/deployments/`.
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
describe("DocsController", function() {
|
|
var $scope;
|
|
|
|
angular.module('fake', [])
|
|
.value('openPlunkr', function() {})
|
|
.value('NG_PAGES', {})
|
|
.value('NG_NAVIGATION', {})
|
|
.value('NG_VERSION', {});
|
|
|
|
beforeEach(module('fake', 'DocsController'));
|
|
beforeEach(inject(function($rootScope, $controller) {
|
|
$scope = $rootScope;
|
|
$controller('DocsController', {$scope: $scope});
|
|
}));
|
|
|
|
|
|
describe('afterPartialLoaded', function() {
|
|
it('should update the Google Analytics with currentPage path if currentPage exists', inject(
|
|
function($window) {
|
|
$window._gaq = [];
|
|
$scope.currentPage = {path: 'a/b/c'};
|
|
$scope.$broadcast('$includeContentLoaded');
|
|
expect($window._gaq.pop()).toEqual(['_trackPageview', 'a/b/c']);
|
|
}
|
|
));
|
|
|
|
|
|
it('should update the Google Analytics with $location.path if currentPage is missing', inject(
|
|
function($window, $location) {
|
|
$window._gaq = [];
|
|
spyOn($location, 'path').andReturn('x/y/z');
|
|
$scope.$broadcast('$includeContentLoaded');
|
|
expect($window._gaq.pop()).toEqual(['_trackPageview', 'x/y/z']);
|
|
}
|
|
));
|
|
});
|
|
});
|