Permalink
Browse files

Even better handling of falsy layer names, and always returning a string

  • Loading branch information...
nvh committed Sep 30, 2016
1 parent 26585ca commit 69cc7a6e0b806135ae5d9f22203a7103a0ca8a62
Showing with 7 additions and 1 deletion.
  1. +1 −1 framer/Layer.coffee
  2. +6 −0 test/tests/LayerTest.coffee
View
@@ -250,7 +250,7 @@ class exports.Layer extends BaseClass
default: ""
get: ->
name = @_getPropertyValue("name")
return name ? ""
return if name? then "#{name}" else ""
set: (value) ->
@_setPropertyValue("name", value)
@@ -331,6 +331,12 @@ describe "Layer", ->
layer.name.should.equal "Test"
layer._element.getAttribute("name").should.equal "Test"
it "should handle false layer names correctly", ->
layer = new Layer
name: 0
layer.name.should.equal "0"
layer._element.getAttribute("name").should.equal "0"
it "should handle background color with image", ->
# We want the background color to be there until an images

0 comments on commit 69cc7a6

Please sign in to comment.