Permalink
Browse files

ScrollComponent tests and defaults

  • Loading branch information...
koenbok committed May 1, 2016
1 parent 9900f3d commit 4854bad3ab6c7efe32015774dd932d1d0adef392
Showing with 27 additions and 2 deletions.
  1. +4 −0 framer/Defaults.coffee
  2. +23 −2 test/tests/ScrollComponentTest.coffee
@@ -72,6 +72,10 @@ Originals =
columns: 3
spacing: 0
backgroundColor: "transparent"
ScrollComponent:
clip: true
mouseWheelEnabled: false
backgroundColor: null
exports.Defaults =
@@ -1,14 +1,35 @@
describe "ScrollComponent", ->
it "should have the right size", ->
scroll = new ScrollComponent
size: 300
scroll.frame.should.eql {x:0, y:0, width:300, height:300}
scroll.content.frame.should.eql {x:0, y:0, width:300, height:300}
it "should have the right content frame with align", ->
scroll = new ScrollComponent
size: 300
layer = new Layer
parent: scroll.content
size: 100
point: Align.center
scroll.content.frame.should.eql {x:0, y:0, width:300, height:300}
layer.frame.should.eql {x:100, y:100, width:100, height:100}
it "should apply constructor options", ->
instance = new ScrollComponent (scrollHorizontal: false)
instance = new ScrollComponent(scrollHorizontal: false)
instance.scrollHorizontal.should.be.false
it "should keep scrollHorizontal value on copy", ->
instance = new ScrollComponent (scrollHorizontal: false)
instance = new ScrollComponent(scrollHorizontal: false)
instance.scrollHorizontal.should.be.false
copy = instance.copy()

0 comments on commit 4854bad

Please sign in to comment.