9360aa2d27
The quotes rule had to be disabled for e2e tests generated from ngdoc because dgeni templates use double quotes as string delimiters. Since we can't have guarantees that dgeni template wrappers will follow the same JS code style the Angular 1 repo uses, we should find a way to enforce our ESLint setup only for the parts in this repo, perhaps via prepending a generated `/* eslint-enable OUR_RULES */` pragma. Closes #15011
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
describe('DocsController', function() {
|
|
var $scope;
|
|
|
|
angular.module('fake', [])
|
|
.value('$cookies', {})
|
|
.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').and.returnValue('x/y/z');
|
|
$scope.$broadcast('$includeContentLoaded');
|
|
expect($window._gaq.pop()).toEqual(['_trackPageview', 'x/y/z']);
|
|
}));
|
|
});
|
|
});
|