From 0ba5e1f394911c66441ea770e09338e82fb6ef49 Mon Sep 17 00:00:00 2001 From: Rémi Tétreault Date: Sun, 30 Apr 2017 15:14:11 -0400 Subject: fixed `SVG.FX.once` so that it add its callback on the last situation instead of the current one --- spec/spec/fx.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spec') 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) + }) }) -- cgit v1.2.3