Permalink
Browse files

Add test and fix for when curveOptions are explicitly set to undefined

  • Loading branch information...
nvh committed Sep 27, 2016
1 parent ec784c9 commit 3220f923d35222e5d524ce4314fc832f0663431b
Showing with 15 additions and 0 deletions.
  1. +1 −0 framer/Animation.coffee
  2. +14 −0 test/tests/LayerAnimationTest.coffee
View
@@ -317,6 +317,7 @@ class exports.Animation extends BaseClass
# This is for compatibility with the direct Animation.time argument. This should
# ideally also be passed as a curveOption
@options.curveOptions ?= {}
if animatorClass in [LinearAnimator, BezierCurveAnimator]
if _.isString(@options.curveOptions) or _.isArray(@options.curveOptions)
@options.curveOptions =
@@ -661,6 +661,20 @@ describe "LayerAnimation", ->
layer.x.should.equal 10
done()
it "should support properties with options that have undefined curveOptions as object", (done) ->
layer = new Layer
layer.animationOptions = time: AnimationTime
animation = layer.animate
x: 10
options:
curve: "linear"
curveOptions: undefined
animation.options.curve.should.equal "linear"
animation.on Events.AnimationEnd, ->
layer.x.should.equal 10
done()
it "should support states", (done) ->
layer = new Layer
layer.animationOptions = time: AnimationTime

0 comments on commit 3220f92

Please sign in to comment.