Skip to content

Commit

Permalink
Add animation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
koenbok committed Sep 30, 2014
1 parent ebcb76b commit a2613e7
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions test/tests/LayerAnimationTest.coffee
Expand Up @@ -150,6 +150,27 @@ describe "LayerAnimation", ->
layer.animateStop() layer.animateStop()
layer.animations().should.not.contain(animation) layer.animations().should.not.contain(animation)


it "should list running animations correctly", (done) ->

layer = new Layer()

animation = layer.animate
properties: {x: 100}
time: 0.5

count = 0

test = ->
layer.animations().length.should.equal 0
count++

if count is 2
done()

animation.on "end", test
animation.on "stop", test


describe "Events", -> describe "Events", ->


it "should throw start", (done) -> it "should throw start", (done) ->
Expand Down Expand Up @@ -234,6 +255,30 @@ describe "LayerAnimation", ->
layer.x.should.be.within(30, 50) layer.x.should.be.within(30, 50)
done() done()


# describe "Repeat", ->

# it "should start repeatedly", (done) ->

# layer = new Layer()

# animation = new Animation
# layer: layer
# properties: {x: layer.x + 10}
# curve: "linear"
# time: AnimationTime
# repeat: 5

# animation.start()

# c = 5

# layer.on "end", ->
# print "hello"
# c--
# if c is 3
# done()


describe "AnimationLoop", -> describe "AnimationLoop", ->


it "should only stop when all animations are done", (done) -> it "should only stop when all animations are done", (done) ->
Expand Down Expand Up @@ -275,6 +320,7 @@ describe "LayerAnimation", ->
layerB.on "end", ready layerB.on "end", ready
layerC.on "end", ready layerC.on "end", ready



describe "Animation", -> describe "Animation", ->


beforeEach -> beforeEach ->
Expand Down

0 comments on commit a2613e7

Please sign in to comment.