mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-05 13:44:42 +00:00
test(docs): don't mock out window unnecessarily
This commit is contained in:
parent
7215afa21c
commit
96bbf729dd
2 changed files with 3 additions and 8 deletions
|
|
@ -65,10 +65,9 @@ describe('Docs Annotations', function() {
|
||||||
|
|
||||||
describe('foldout directive', function() {
|
describe('foldout directive', function() {
|
||||||
|
|
||||||
var $scope, parent, element, url, window;
|
var $scope, parent, element, url;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
module(function($provide, $animateProvider) {
|
module(function($provide, $animateProvider) {
|
||||||
$provide.value('$window', window = createMockWindow());
|
|
||||||
$animateProvider.register('.foldout', function($timeout) {
|
$animateProvider.register('.foldout', function($timeout) {
|
||||||
return {
|
return {
|
||||||
enter : function(element, done) {
|
enter : function(element, done) {
|
||||||
|
|
@ -158,17 +157,13 @@ describe('Docs Annotations', function() {
|
||||||
|
|
||||||
describe('DocsController fold', function() {
|
describe('DocsController fold', function() {
|
||||||
|
|
||||||
var window, $scope, ctrl;
|
var $scope, ctrl;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
module(function($provide, $animateProvider) {
|
|
||||||
$provide.value('$window', window = createMockWindow());
|
|
||||||
});
|
|
||||||
inject(function($rootScope, $controller, $location, $cookies, sections) {
|
inject(function($rootScope, $controller, $location, $cookies, sections) {
|
||||||
$scope = $rootScope.$new();
|
$scope = $rootScope.$new();
|
||||||
ctrl = $controller('DocsController',{
|
ctrl = $controller('DocsController',{
|
||||||
$scope : $scope,
|
$scope : $scope,
|
||||||
$location : $location,
|
$location : $location,
|
||||||
$window : window,
|
|
||||||
$cookies : $cookies,
|
$cookies : $cookies,
|
||||||
sections : sections
|
sections : sections
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ describe('DocsApp', function() {
|
||||||
|
|
||||||
$scope.jumpToDocsVersion('2.1.3');
|
$scope.jumpToDocsVersion('2.1.3');
|
||||||
expect(window.location).toBe('http://code.angularjs.org/2.1.3/docs');
|
expect(window.location).toBe('http://code.angularjs.org/2.1.3/docs');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should jump to the older versions of current docs for version >= 1.0.2', function() {
|
it('should jump to the older versions of current docs for version >= 1.0.2', function() {
|
||||||
$scope.jumpToDocsVersion('1.0.1');
|
$scope.jumpToDocsVersion('1.0.1');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue