diff --git a/src/collapse/collapse.js b/src/collapse/collapse.js index bb40a92576..1f5f005f97 100644 --- a/src/collapse/collapse.js +++ b/src/collapse/collapse.js @@ -75,7 +75,6 @@ angular.module('ui.bootstrap.collapse', ['ui.bootstrap.transition']) expand(); } }); - } }; }]); diff --git a/src/collapse/test/collapse.spec.js b/src/collapse/test/collapse.spec.js index d3784ad4c6..f2069b1135 100644 --- a/src/collapse/test/collapse.spec.js +++ b/src/collapse/test/collapse.spec.js @@ -55,6 +55,23 @@ describe('collapse directive', function () { expect(element.height()).not.toBe(0); }); + it('should expand if isCollapsed = true with animation on subsequent uses', function() { + scope.isCollapsed = false; + scope.$digest(); + scope.isCollapsed = true; + scope.$digest(); + scope.isCollapsed = false; + scope.$digest(); + scope.isCollapsed = true; + scope.$digest(); + $timeout.flush(); + expect(element.height()).toBe(0); + if ($transition.transitionEndEventName) { + element.triggerHandler($transition.transitionEndEventName); + expect(element.height()).toBe(0); + } + }); + describe('dynamic content', function() { beforeEach(function() { element = angular.element('
Initial content