summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorRémi Tétreault <tetreault.remi@gmail.com>2017-04-30 15:14:11 -0400
committerRémi Tétreault <tetreault.remi@gmail.com>2017-04-30 15:14:11 -0400
commit0ba5e1f394911c66441ea770e09338e82fb6ef49 (patch)
treedf6c225df194a9292803ca2d57b98debfb8368da /spec
parent4204181064ab17c82fc0cde227a84e31512d6973 (diff)
downloadsvg.js-0ba5e1f394911c66441ea770e09338e82fb6ef49.tar.gz
svg.js-0ba5e1f394911c66441ea770e09338e82fb6ef49.zip
fixed `SVG.FX.once` so that it add its callback on the last situation instead of the current one
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/fx.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/spec/fx.js b/spec/spec/fx.js
index 78101d4..e17cb95 100644
--- a/spec/spec/fx.js
+++ b/spec/spec/fx.js
@@ -1227,6 +1227,15 @@ describe('FX', function() {
fx.step()
expect(called).toBe(true)
})
+
+ it('adds the callback on the last situation', function () {
+ var callback = function () {}
+
+ fx.animate(500).animate(500).once(0.5, callback)
+ expect(fx.situation.once['0.5']).toBeUndefined()
+ expect(fx.situations[0].once['0.5']).toBeUndefined()
+ expect(fx.situations[1].once['0.5']).toBe(callback)
+ })
})