aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorRémi Tétreault <tetreault.remi@gmail.com>2017-05-14 13:21:50 -0400
committerRémi Tétreault <tetreault.remi@gmail.com>2017-05-14 13:21:50 -0400
commitefc4fdf111f507ef8a7c482ddc6e9dc449bfa0b5 (patch)
tree54920e5664cc0a54123b0c765db95cea60a30e0f /spec
parent5f22d28f669d5697ce73d20b40fcf0a7179db86e (diff)
downloadsvg.js-efc4fdf111f507ef8a7c482ddc6e9dc449bfa0b5.tar.gz
svg.js-efc4fdf111f507ef8a7c482ddc6e9dc449bfa0b5.zip
fixed `SVG.FX.step` so that the animation doesn't stop if an afterAll callback call animate (#677)
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/fx.js37
1 files changed, 27 insertions, 10 deletions
diff --git a/spec/spec/fx.js b/spec/spec/fx.js
index d6d87f2..edf2081 100644
--- a/spec/spec/fx.js
+++ b/spec/spec/fx.js
@@ -1675,18 +1675,35 @@ describe('FX', function() {
expect(fx.pos).toBe(1) // It should end not reversed, which mean the position is expected to be 1
// ((9-1)-6) is even, the -1 is because we do not want reversed to be toggled after the last loop
})
+ })
- it('should not throw an error when stop is called in a during callback', function () {
- fx.move(100,100).start()
- fx.during(function () {this.stop()})
- expect(fx.step.bind(fx)).not.toThrow()
- })
- it('should not throw an error when finish is called in a during callback', function () {
- fx.move(100,100).start()
- fx.during(function () {this.finish()})
- expect(fx.step.bind(fx)).not.toThrow()
- })
+ it('should not throw an error when stop is called in a during callback', function () {
+ fx.move(100,100).start()
+ fx.during(function () {this.stop()})
+ expect(fx.step.bind(fx)).not.toThrow()
+ })
+
+ it('should not throw an error when finish is called in a during callback', function () {
+ fx.move(100,100).start()
+ fx.during(function () {this.finish()})
+ expect(fx.step.bind(fx)).not.toThrow()
+ })
+
+ it('should not set active to false if the afterAll callback add situations to the situations queue', function () {
+ fx.afterAll(function(){this.animate(500).move(0,0)})
+
+ jasmine.clock().tick(500)
+ fx.step()
+ expect(fx.active).toBe(true)
+ expect(fx.situation).not.toBeNull()
+ expect(fx.situations.length).toBe(0)
+
+ jasmine.clock().tick(500)
+ fx.step()
+ expect(fx.active).toBe(false)
+ expect(fx.situation).toBeNull()
+ expect(fx.situations.length).toBe(0)
})
})