diff options
author | Denis Mosolov <denismosolov@gmail.com> | 2015-12-29 14:19:54 +0300 |
---|---|---|
committer | Denis Mosolov <denismosolov@gmail.com> | 2015-12-29 14:38:54 +0300 |
commit | a7eaeb4b06319fd78a586dfb6fb4d82710fd9d6f (patch) | |
tree | 8ef56492b4a8b9d2064c5e080596dc638d7e38ae /spec | |
parent | 2b97c7e4199427fd7cca5928cf68945bd388df7e (diff) | |
download | svg.js-a7eaeb4b06319fd78a586dfb6fb4d82710fd9d6f.tar.gz svg.js-a7eaeb4b06319fd78a586dfb6fb4d82710fd9d6f.zip |
fix #433
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/group.js | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/spec/spec/group.js b/spec/spec/group.js index 88772e0..63335ae 100644 --- a/spec/spec/group.js +++ b/spec/spec/group.js @@ -5,7 +5,7 @@ describe('Group', function() { group = draw.group().move(50, 50) group.rect(100,100) }) - + afterEach(function() { draw.clear() }) @@ -24,8 +24,13 @@ describe('Group', function() { var box = group.gbox() expect(box.x).toBe(13) }) + it('sets the value of x correctly when the first argument is a string number', function(){ + group.x('123') + var box = group.gbox() + expect(box.x).toBe(123) + }) }) - + describe('y()', function() { it('returns the value of y without an argument', function() { expect(group.y()).toBe(50) @@ -40,8 +45,13 @@ describe('Group', function() { var box = group.gbox() expect(box.y).toBe(15) }) + it('sets the value of y correctly when the first argument is a string number', function(){ + group.y('124') + var box = group.gbox() + expect(box.y).toBe(124) + }) }) - + describe('cx()', function() { it('returns the value of cx without an argument', function() { expect(group.cx()).toBe(100) @@ -52,7 +62,7 @@ describe('Group', function() { expect(box.cx).toBe(123) }) }) - + describe('cy()', function() { it('returns the value of cy without an argument', function() { expect(group.cy()).toBe(100) @@ -70,7 +80,7 @@ describe('Group', function() { expect(group.node.getAttribute('transform')).toBe('matrix(1,0,0,1,123,456)') }) }) - + describe('center()', function() { it('sets the cx and cy position', function() { group.center(321,567) @@ -103,6 +113,6 @@ describe('Group', function() { expect(group.node.getAttribute('transform')).toBe('matrix(1,0,0,1,130,85)') }) }) - -})
\ No newline at end of file + +}) |