 				layer.style.backgroundColor.should.equal new Color("red").toString()
 				done()
 
-			layer.states.switch "stateA", {curve:"linear", time:0.1}
+			layer.animateTo "stateA", {curve:"linear", time:0.1}
 
 		it "should restore the default state when using non exportable properties", ->
 
 			layer = new Layer
-			layer.states.add
+			layer.states =
 				stateA: {midX:200}
 
 			layer.x.should.equal 0
 
-			layer.states.switchInstant "stateA"
+			layer.animateTo "stateA", instant: true
 			layer.x.should.equal 200 - (layer.width // 2)
 
-			layer.states.switchInstant "default"
+			layer.animateTo "initial", instant: true
 			layer.x.should.equal 0
 
 		it "should set the parent", ->

				layer.style.backgroundColor.should.equal new Color("red").toString()
				done()

			layer.states.switch "stateA"

		it "should set non and numeric properties with animation", (done) ->

			layer = new Layer
			layer.states.add
				stateA: {x:200, backgroundColor:"red"}

			# layer.scroll.should.equal false

		it "should set defaults", ->

			layer = new Layer
			layer.states.test = {x:123}
			animation = layer.animateTo "test"

			animation.options.curve.should.equal Framer.Defaults.Animation.curve

			Framer.Defaults.Animation =
				curve: "spring(1, 2, 3)"

			layer = new Layer
			layer.states.test = {x:456}
			animation = layer.animateTo "test"

			animation.options.curve.should.equal "spring(1, 2, 3)"

			Framer.resetDefaults()

		# it "should convert string to colors in states", ->
		# 	layer = new Layer
		# 	layer.states.test =
		# 			backgroundColor:"fff"
		# 			color: "000"
		# 	layer.states.test.backgroundColor.isEqual(new Color("fff")).should.be.true
		# 	layer.states.test.color.isEqual(new Color("000")).should.be.true



