diff options
| author | William Bagayoko | 2013-04-03 19:34:47 -0500 |
|---|---|---|
| committer | Igor Minar | 2013-04-03 18:42:17 -0700 |
| commit | 308a59bf445759b32c20e9057a6dcc241042bdca (patch) | |
| tree | ef10b4f80e289917800f3d5abfe4f29c35f0bc49 /test | |
| parent | 19f1801379104bc1f74fbb9d288f71034ba829c9 (diff) | |
| download | angular.js-308a59bf445759b32c20e9057a6dcc241042bdca.tar.bz2 | |
fix(ngAnimator): correct polyfillSetup activation and memento generation
Diffstat (limited to 'test')
| -rw-r--r-- | test/ng/animatorSpec.js | 21 |
1 files changed, 21 insertions, 0 deletions
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('<div></div>')($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) { |
