From f4f1f43d5140385bbf070510975f72b65196e08a Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Wed, 26 Feb 2014 16:07:36 -0500 Subject: fix($animate): ensure all comment nodes are removed during a leave animation Closes #6403 --- test/ngAnimate/animateSpec.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test') diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index eaed757e..6dd3b117 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -3418,6 +3418,27 @@ describe("ngAnimate", function() { }); }); + it('should remove all element and comment nodes during leave animation', + inject(function($compile, $rootScope) { + + $rootScope.items = [1,2,3,4,5]; + + var element = html($compile( + '
' + + '
start
' + + '
end
' + + '
' + )($rootScope)); + + $rootScope.$digest(); + + $rootScope.items = []; + + $rootScope.$digest(); + + expect(element.children().length).toBe(0); + })); + it('should not throw an error when only comment nodes are rendered in the animation', inject(function($rootScope, $compile) { -- cgit v1.2.3