diff options
author | wout <wout@impinc.co.uk> | 2013-04-15 13:17:20 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-04-15 13:17:20 +0100 |
commit | a736acc12e4ca1a71b9f563f7ed361e2a3540469 (patch) | |
tree | c2e1d52070454ce1f26de9174f6a22b1568b4d28 /spec | |
parent | d0c34f778e854bd5f3e1c15d853bd126aad2d85d (diff) | |
download | svg.js-a736acc12e4ca1a71b9f563f7ed361e2a3540469.tar.gz svg.js-a736acc12e4ca1a71b9f563f7ed361e2a3540469.zip |
Parsing numeric values as a global getter0.14
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/element.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/spec/element.js b/spec/spec/element.js index 757025a..167c0b9 100644 --- a/spec/spec/element.js +++ b/spec/spec/element.js @@ -64,6 +64,22 @@ describe('Element', function() { rect.style('style', '') expect(rect.node.getAttribute('style')).toBe(null) }) + it('should act as a global getter when no arguments are given', function() { + rect.fill('#ff0066') + expect(rect.attr().fill).toBe('#ff0066') + }) + it('should correctly parse numeric values as a global getter', function() { + rect.stroke({ width: 20 }) + expect(rect.attr()['stroke-width']).toBe(20) + }) + it('should correctly parse negative numeric values as a global getter', function() { + rect.x(-30) + expect(rect.attr().x).toBe(-30) + }) + it('should leave unit values alone as a global getter', function() { + rect.attr('x', '69%') + expect(rect.attr().x).toBe('69%') + }) }) describe('style()', function() { |