diff options
| author | Jeff Cross | 2013-05-29 13:44:59 -0700 |
|---|---|---|
| committer | Misko Hevery | 2013-05-30 23:43:27 -0700 |
| commit | e1a050e6b26aca4d0e6e7125d3f6c1c8fc1d92cb (patch) | |
| tree | e103549e9287a389742d57f04db0cc6f65f171f8 /test/ng/animatorSpec.js | |
| parent | a4b9a6aca9a0d4b1e3be2238cf549083776284ba (diff) | |
| download | angular.js-e1a050e6b26aca4d0e6e7125d3f6c1c8fc1d92cb.tar.bz2 | |
fix(jqLite): Added optional name arg in removeData
jQuery's API for removeData allows a second 'name' argument to just
remove the property by that name from an element's data. The absence
of this argument was causing some features not to work correctly when
combining multiple directives, such as ng-click, ng-show, and ng-animate.
Diffstat (limited to 'test/ng/animatorSpec.js')
| -rw-r--r-- | test/ng/animatorSpec.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ng/animatorSpec.js b/test/ng/animatorSpec.js index 43983609..63fcf5c3 100644 --- a/test/ng/animatorSpec.js +++ b/test/ng/animatorSpec.js @@ -345,11 +345,33 @@ describe("$animator", function() { }); child.css('display','none'); + element.data('foo', 'bar'); animator.show(element); window.setTimeout.expect(1).process(); + animator.hide(element); expect(element.hasClass('animation-cancelled')).toBe(true); + expect(element.data('foo')).toEqual('bar'); + })); + + it("should NOT clobber all data on an element when animation is finished", + inject(function($animator, $rootScope) { + $animator.enabled(true); + + animator = $animator($rootScope, { + ngAnimate : '{hide: \'custom-delay\', show: \'custom-delay\'}' + }); + + child.css('display','none'); + element.data('foo', 'bar'); + + animator.show(element); + window.setTimeout.expect(1).process(); + + animator.hide(element); + + expect(element.data('foo')).toEqual('bar'); })); |
