diff options
Diffstat (limited to 'test/ng')
| -rwxr-xr-x | test/ng/compileSpec.js | 57 | ||||
| -rw-r--r-- | test/ng/httpBackendSpec.js | 2 | ||||
| -rw-r--r-- | test/ng/parseSpec.js | 13 | ||||
| -rw-r--r-- | test/ng/qSpec.js | 9 | ||||
| -rw-r--r-- | test/ng/sceSpecs.js | 4 |
5 files changed, 8 insertions, 77 deletions
diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 844511a3..13604f6f 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -1488,16 +1488,6 @@ describe('$compile', function() { ); - it('should not allow more then one isolate scope creation per element', inject( - function($rootScope, $compile) { - expect(function(){ - $compile('<div class="iscope-a; iscope-b"></div>'); - }).toThrowMinErr('$compile', 'multidir', 'Multiple directives [iscopeA, iscopeB] asking for isolated scope on: ' + - '<div class="iscope-a; iscope-b ng-isolate-scope ng-scope">'); - }) - ); - - it('should create new scope even at the root of the template', inject( function($rootScope, $compile, log) { element = $compile('<div scope-a></div>')($rootScope); @@ -1824,24 +1814,6 @@ describe('$compile', function() { }); }); - it('should allow setting of attributes', function() { - module(function() { - directive({ - setter: valueFn(function(scope, element, attr) { - attr.$set('name', 'abc'); - attr.$set('disabled', true); - expect(attr.name).toBe('abc'); - expect(attr.disabled).toBe(true); - }) - }); - }); - inject(function($rootScope, $compile) { - element = $compile('<div setter></div>')($rootScope); - expect(element.attr('name')).toEqual('abc'); - expect(element.attr('disabled')).toEqual('disabled'); - }); - }); - it('should create new instance of attr for each template stamping', function() { module(function($provide) { @@ -2055,32 +2027,15 @@ describe('$compile', function() { $rootScope.name = 'misko'; $rootScope.$apply(); - expect(componentScope.ref).toBe($rootScope.name); - expect(componentScope.refAlias).toBe($rootScope.name); - - $rootScope.name = {}; - $rootScope.$apply(); - expect(componentScope.ref).toBe($rootScope.name); - expect(componentScope.refAlias).toBe($rootScope.name); - })); - - - it('should update local when origin changes', inject(function() { - compile('<div><span my-component ref="name">'); - expect(componentScope.ref).toBe(undefined); - expect(componentScope.refAlias).toBe(componentScope.ref); - componentScope.ref = 'misko'; - $rootScope.$apply(); expect($rootScope.name).toBe('misko'); expect(componentScope.ref).toBe('misko'); - expect($rootScope.name).toBe(componentScope.ref); - expect(componentScope.refAlias).toBe(componentScope.ref); + expect(componentScope.refAlias).toBe('misko'); - componentScope.name = {}; + $rootScope.name = {}; $rootScope.$apply(); - expect($rootScope.name).toBe(componentScope.ref); - expect(componentScope.refAlias).toBe(componentScope.ref); + expect(componentScope.ref).toBe($rootScope.name); + expect(componentScope.refAlias).toBe($rootScope.name); })); @@ -3379,7 +3334,7 @@ describe('$compile', function() { })); - it('should group on nested groups', inject(function($compile, $rootScope) { + it('should group on nested groups of same directive', inject(function($compile, $rootScope) { $rootScope.show = false; element = $compile( '<div></div>' + @@ -3427,7 +3382,7 @@ describe('$compile', function() { }); - it('should throw error if unterminated', function () { + it('should throw error if unterminated (containing termination as a child)', function () { module(function($compileProvider) { $compileProvider.directive('foo', function() { return { diff --git a/test/ng/httpBackendSpec.js b/test/ng/httpBackendSpec.js index c65ab2e1..d533d5f8 100644 --- a/test/ng/httpBackendSpec.js +++ b/test/ng/httpBackendSpec.js @@ -376,7 +376,7 @@ describe('$httpBackend', function() { }); - it('should convert 0 to 200 if content - relative url', function() { + it('should convert 0 to 404 if no content - relative url', function() { $backend = createHttpBackend($browser, MockXhr, null, null, null, 'file'); $backend('GET', '/whatever/index.html', null, callback); diff --git a/test/ng/parseSpec.js b/test/ng/parseSpec.js index 7673066b..a82f736f 100644 --- a/test/ng/parseSpec.js +++ b/test/ng/parseSpec.js @@ -717,17 +717,6 @@ describe('parser', function() { }); - it('should call the function once when it is not part of the context', function() { - var count = 0; - scope.fn = function() { - count++; - return function() { return 'lucas'; }; - }; - expect(scope.$eval('fn()()')).toBe('lucas'); - expect(count).toBe(1); - }); - - it('should call the function once when it is part of the context on assignments', function() { var count = 0; var element = {}; @@ -766,7 +755,7 @@ describe('parser', function() { }); - it('should call the function once when it is part of the context on array lookup function', function() { + it('should call the function once when it is part of the context on property lookup function', function() { var count = 0; var element = {name: {anotherFn: function() { return 'lucas';} } }; scope.fn = function() { diff --git a/test/ng/qSpec.js b/test/ng/qSpec.js index 13c51f4b..7c949602 100644 --- a/test/ng/qSpec.js +++ b/test/ng/qSpec.js @@ -1468,15 +1468,6 @@ describe('q', function() { it('should still reject the promise, when exception is thrown in success handler, even if exceptionHandler rethrows', function() { - deferred.promise.then(function() { throw 'reject'; }).then(null, errorSpy); - deferred.resolve('resolve'); - mockNextTick.flush(); - expect(exceptionExceptionSpy).toHaveBeenCalled(); - expect(errorSpy).toHaveBeenCalled(); - }); - - - it('should still reject the promise, when exception is thrown in success handler, even if exceptionHandler rethrows', function() { deferred.promise.then(null, function() { throw 'reject again'; }).then(null, errorSpy); deferred.reject('reject'); mockNextTick.flush(); diff --git a/test/ng/sceSpecs.js b/test/ng/sceSpecs.js index 75c1fbaa..1eb382f6 100644 --- a/test/ng/sceSpecs.js +++ b/test/ng/sceSpecs.js @@ -139,10 +139,6 @@ describe('SCE', function() { expect($sce.trustAsHtml("")).toBe(""); })); - it('should unwrap null into null', inject(function($sce) { - expect($sce.getTrusted($sce.HTML, null)).toBe(null); - })); - it('should unwrap "" into ""', inject(function($sce) { expect($sce.getTrusted($sce.HTML, "")).toBe(""); })); |
