]> source.dussan.org Git - svg.js.git/commitdiff
add failing test
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>
Thu, 31 May 2018 06:53:57 +0000 (08:53 +0200)
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>
Thu, 31 May 2018 06:53:57 +0000 (08:53 +0200)
spec/spec/runner.js

index 2e1007b6f663011872a595b5f57c72cc20e8318e..e90bb5745eae424ab04e8e9dff07348cf41464f0 100644 (file)
@@ -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 () {