diff options
author | Rémi Tétreault <tetreault.remi@gmail.com> | 2016-10-17 14:15:18 -0400 |
---|---|---|
committer | Rémi Tétreault <tetreault.remi@gmail.com> | 2016-10-17 14:15:18 -0400 |
commit | 91d4934ca6d83792aae8bbebc900e69f9f4df205 (patch) | |
tree | cb6ee33c0cc68c786c7f505fed666637348c3853 /spec | |
parent | a6261cda9dd9d030157333ba4f001e088e535c29 (diff) | |
download | svg.js-91d4934ca6d83792aae8bbebc900e69f9f4df205.tar.gz svg.js-91d4934ca6d83792aae8bbebc900e69f9f4df205.zip |
Make speed(0) pause the animation
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/fx.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/spec/fx.js b/spec/spec/fx.js index 5849598..f050a2a 100644 --- a/spec/spec/fx.js +++ b/spec/spec/fx.js @@ -148,13 +148,18 @@ describe('FX', function() { fx.speed(0.5) expect(fx.speed()).toBe(0.5) - fx.speed(0) - expect(fx.speed()).toBe(0.5) - fx.speed(1) expect(fx.speed()).toBe(1) }) + it('pause the animation when a speed of 0 is passed', function(){ + var currentSpeed = fx.speed() + + expect(fx.speed(0)).toBe(fx) + expect(fx.speed()).toBe(currentSpeed) + expect(fx.paused).toBe(true) + }) + it('should affect all animations in the queue', function(done){ fx.speed(2).animate(300).start() expect(fx.situations.length).not.toBe(0) |