diff options
-rw-r--r-- | spec/spec/runner.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/spec/runner.js b/spec/spec/runner.js index 2e1007b..e90bb57 100644 --- a/spec/spec/runner.js +++ b/spec/spec/runner.js @@ -253,6 +253,18 @@ describe('SVG.Runner', function () { expect(initFn).toHaveBeenCalled() expect(runFn).toHaveBeenCalledWith(1) }) + + it('does behave correctly at the end of reversed loop', function () { + var spy = jasmine.createSpy('stepper') + var runner = new SVG.Runner(1000).loop(6, true) + runner.queue(null, spy) + + // the 6th loop is reversed + runner.step(5750) + expect(spy).toHaveBeenCalledWith(0.25) + runner.step(250) + expect(spy).toHaveBeenCalledWith(0) + }) }) describe('active()', function () { |