summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorRémi Tétreault <tetreault.remi@gmail.com>2017-03-05 20:55:09 -0500
committerRémi Tétreault <tetreault.remi@gmail.com>2017-03-07 20:44:58 -0500
commit9165ee80eca0be42970ccbc5470f5541f206f7f3 (patch)
tree5edc0e305ce082ab91b1bffa0d78ae7047a2be21 /spec
parent927aeaeafa4e3bf21390b86f1a5087b49558db49 (diff)
downloadsvg.js-9165ee80eca0be42970ccbc5470f5541f206f7f3.tar.gz
svg.js-9165ee80eca0be42970ccbc5470f5541f206f7f3.zip
Make the method dequeue stop the current animation
There was a bug in the dequeue method of the FX module. It was not stopping the current animation as it was supposed too. This bug is now fixed. Also, I rewritten the test that @fuzzyma left commented. I changed its implementation to not use the once callback since there seem to be some issues when combining once and dequeue. The method stop was also modified, it now call start only when it's revelant.
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/fx.js25
1 files changed, 9 insertions, 16 deletions
diff --git a/spec/spec/fx.js b/spec/spec/fx.js
index da09cc6..de05dcb 100644
--- a/spec/spec/fx.js
+++ b/spec/spec/fx.js
@@ -981,22 +981,15 @@ describe('FX', function() {
expect(called).toBe(true)
})
- /*it('should stop the currently running animation when there is one', function() {
- var called = false
-
- fx.start().once(0.5, function(pos, eased) {
- console.warn('asds')
- expect(pos).toBeCloseTo(0.5)
- this.fx.dequeue()
- })//.queue(function(){ called=true; expect(this).toBe(fx) })
-
- //jasmine.clock().tick(125)
- //fx.step()
- //expect(called).toBe(false)
- //jasmine.clock().tick(125)
- //fx.step()
- //expect(called).toBe(true)
- })*/
+ it('should stop the currently running animation when there is one', function() {
+ fx.start()
+ expect(fx.active).toBe(true)
+ fx.queue(function() {
+ expect(this.active).toBe(false)
+ this.dequeue()
+ })
+ fx.dequeue()
+ })
})