aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/animatorSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ng/animatorSpec.js')
-rw-r--r--test/ng/animatorSpec.js22
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');
}));