diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index 3b53c7d2bd21..633ec0e04fe3 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -1,7 +1,7 @@ 'use strict'; describe('widget', function() { - describe('ng:switch', inject(function($rootScope, $compile) { + describe('ng:switch', function() { it('should switch on value change', inject(function($rootScope, $compile) { var element = $compile( '' + @@ -26,7 +26,7 @@ describe('widget', function() { $rootScope.$apply(); expect(element.text()).toEqual('true:misko'); })); - + it('should switch on switch-when-default', inject(function($rootScope, $compile) { var element = $compile( @@ -41,7 +41,7 @@ describe('widget', function() { expect(element.text()).toEqual('one'); })); - + it('should call change on switch', inject(function($rootScope, $compile) { var element = $compile( '' + @@ -52,7 +52,7 @@ describe('widget', function() { expect($rootScope.name).toEqual(undefined); expect(element.text()).toEqual('works'); })); - })); + }); describe('ng:include', inject(function($rootScope, $compile) { @@ -149,6 +149,7 @@ describe('widget', function() { expect($rootScope.$$childHead).toBeFalsy(); })); + it('should do xhr request and cache it', inject(function($rootScope, $httpBackend, $compile, $browser) { var element = $compile('')($rootScope); @@ -170,6 +171,7 @@ describe('widget', function() { dealoc($rootScope); })); + it('should clear content when error during xhr request', inject(function($httpBackend, $compile, $rootScope) { var element = $compile('content')($rootScope); @@ -182,6 +184,7 @@ describe('widget', function() { expect(element.text()).toBe(''); })); + it('should be async even if served from cache', inject( putIntoCache('myUrl', 'my partial'), function($rootScope, $compile, $browser) { @@ -200,6 +203,7 @@ describe('widget', function() { expect(element.text()).toBe('my partial'); })); + it('should discard pending xhr callbacks if a new template is requested before the current ' + 'finished loading', inject(function($rootScope, $compile, $httpBackend) { var element = jqLite(""), @@ -226,7 +230,7 @@ describe('widget', function() { })); - describe('a', inject(function($rootScope, $compile) { + describe('a', function() { it('should prevent default action to be executed when href is empty', inject(function($rootScope, $compile) { var orgLocation = document.location.href, @@ -261,10 +265,10 @@ describe('widget', function() { expect(document.location.href).toEqual(orgLocation); })); - })); + }); - describe('@ng:repeat', inject(function($rootScope, $compile) { + describe('@ng:repeat', function() { it('should ng:repeat over array', inject(function($rootScope, $compile) { var element = $compile( '