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.js21
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) {