Permalink
Browse files

Merge pull request #241 from jchavarri/fix-issue-86

Adding tests for state next() function and reversing commit ecf3c54
  • Loading branch information...
koenbok committed Sep 7, 2015
2 parents d017d6e + e8dc177 commit a6eb69793f1d58a1263b1fd6ad1be63155a4947d
Showing with 30 additions and 1 deletion.
  1. +0 −1 framer/LayerStates.coffee
  2. +30 −0 test/tests/LayerStatesTest.coffee
@@ -138,7 +138,6 @@ class exports.LayerStates extends BaseClass
keys = []
for stateName, state of @_states
continue if stateName is "default"
keys = _.union(keys, _.keys(state))
keys
@@ -73,6 +73,36 @@ describe "LayerStates", ->
describe "Properties", ->
it "should bring back the 'default' state values when using 'next'", (done) ->
layer = new Layer
layer.states.add
stateA: {x:100, rotation: 90}
stateB: {x:200, rotation: 180}
layer.states.animationOptions =
curve: "linear"
time: 0.05
layer.x.should.equal 0
ready = (animation, layer) ->
switch layer.states.current
when "stateA"
layer.x.should.equal 100
layer.rotation.should.equal 90
layer.states.next()
when "stateB"
layer.x.should.equal 200
layer.rotation.should.equal 180
layer.states.next()
when "default"
layer.x.should.equal 0
layer.rotation.should.equal 0
done()
layer.on "end", ready
layer.states.next()
it "should set scroll property", ->
layer = new Layer

0 comments on commit a6eb697

Please sign in to comment.