diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-11-15 21:57:31 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-12-12 14:15:37 +0100 |
commit | d249f07e5e7f057ce8897c3d7101c26be477a812 (patch) | |
tree | a51bd3879d5c13468095eceaa3194b06ca84c4bd | |
parent | 13587eaf3cac41ddf4dc527fe0898793a00173d8 (diff) | |
download | svg.js-d249f07e5e7f057ce8897c3d7101c26be477a812.tar.gz svg.js-d249f07e5e7f057ce8897c3d7101c26be477a812.zip |
added new provisionally specs for fx
-rw-r--r-- | bower.json | 2 | ||||
-rw-r--r-- | component.json | 2 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | spec/spec/fx.js | 65 |
4 files changed, 68 insertions, 3 deletions
@@ -1,6 +1,6 @@ { "name": "svg.js", - "version":"2.2.4", + "version":"3.0.0", "homepage": "http://svgjs.com/", "authors": [ "Wout Fierens <wout@impinc.co.uk>" diff --git a/component.json b/component.json index c5bbc14..5336580 100644 --- a/component.json +++ b/component.json @@ -2,7 +2,7 @@ "name": "svg.js", "repo": "wout/svg.js", "description": "A lightweight library for manipulating and animating SVG", - "version": "2.2.4", + "version": "3.0.0", "keywords": ["svg"], "author": "Wout Fierens <wout@impinc.co.uk>", "main": "dist/svg.js", diff --git a/package.json b/package.json index f7a8aed..e595757 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "svg.js", - "version": "2.2.4", + "version": "3.0.0", "description": "A lightweight library for manipulating and animating SVG.", "url": "http://svgjs.com", "homepage": "http://www.svgjs.com", diff --git a/spec/spec/fx.js b/spec/spec/fx.js index f1171f5..e93eb4d 100644 --- a/spec/spec/fx.js +++ b/spec/spec/fx.js @@ -9,6 +9,71 @@ describe('FX', function() { it('creates an instance of SVG.FX', function() { expect(fx instanceof SVG.FX).toBe(true) }) + + it('creates a new queue and pushes one animation into it', function() { + expect(fx._queue.length).toBe(1) + expect(fx._queue[0] instance of SVG.QueueItem).toBe(true) + }) + + describe('queue()', function() { + it('returns the queue of this animation instance', function() { + expect(fx.queue() instanceof Array).toBe(true) + }) + }) + + describe('enqueue()', function() { + it('pushes one item to the animation queue', function() { + expect(fx.enqueue(500).queue().length).toBe(2) + }) + }) + + describe('reverse()', function() { + it('sets the direction of the animation to -1', function() { + expect(fx.reverse()._direction).toBe(-1) + }) + }) + + describe('play()', function() { + it('sets the direction of the animation to 1', function() { + expect(fx.play()._direction).toBe(1) + }) + }) + + describe('get()', function() { + it('gets the specified situation object from the queue', function() { + expect(fx.get(0)).toBe(fx.queue()[0]) + }) + }) + + describe('seek()', function() { + it('sets the position of the whole animation queue to the specified position', function() { + expect(fx.seek(0.5)._pos).toBe(0.5) + }) + }) + + describe('get(0).seek()', function() { + it('sets the position of a certain animation in the queue to the specified position', function() { + expect(fx.get(0).seek(0.5)._pos).toBe(0.5) + }) + }) + + describe('stop()', function() { + it('sets the direction of the animation to 0', function() { + expect(fx.stop()._direction).toBe(0) + }) + }) + + describe('finish()', function() { + it('sets the position of the whole animation queue to 1', function() { + expect(fx.finish()._pos).toBe(1) + }) + }) + + describe('get(0).finish()', function() { + it('sets the position of a certain animation in the queue to 1', function() { + expect(fx.get(0).finish(1)._pos).toBe(1) + }) + }) it('animates the x/y-attr', function(done) { |