From 308a59bf445759b32c20e9057a6dcc241042bdca Mon Sep 17 00:00:00 2001 From: William Bagayoko Date: Wed, 3 Apr 2013 19:34:47 -0500 Subject: fix(ngAnimator): correct polyfillSetup activation and memento generation --- test/ng/animatorSpec.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/ng') diff --git a/test/ng/animatorSpec.js b/test/ng/animatorSpec.js index 07bcb36c..a8c6c547 100644 --- a/test/ng/animatorSpec.js +++ b/test/ng/animatorSpec.js @@ -76,6 +76,17 @@ describe("$animator", function() { } } }); + $animationProvider.register('setup-memo', function() { + return { + setup: function(element) { + return "memento"; + }, + start: function(element, done, memento) { + element.text(memento); + done(); + } + } + }); }) inject(function($animator, $compile, $rootScope) { element = $compile('
')($rootScope); @@ -185,6 +196,16 @@ describe("$animator", function() { expect(child.attr('class')).toContain('custom-leave-start'); window.setTimeout.expect(0).process(); })); + + it("should run polyfillSetup and return the memento", inject(function($animator, $rootScope) { + animator = $animator($rootScope, { + ngAnimate : '{show: \'setup-memo\'}' + }); + expect(element.text()).toEqual(''); + animator.show(element); + window.setTimeout.expect(1).process(); + expect(element.text()).toBe('memento'); + })); }); it("should throw an error when an invalid ng-animate syntax is provided", inject(function($compile, $rootScope) { -- cgit v1.2.3