diff options
author | wout <wout@impinc.co.uk> | 2014-02-03 21:59:15 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-02-03 21:59:15 +0100 |
commit | 189f009dbb28525f3eb2c0bb7a72312cb6fe4ba6 (patch) | |
tree | 39728b3425c7906b772a84d46778d33e34770ddf /spec | |
parent | 8dcb37d3406a85ef639e31b256823cf24fd7b7c6 (diff) | |
download | svg.js-189f009dbb28525f3eb2c0bb7a72312cb6fe4ba6.tar.gz svg.js-189f009dbb28525f3eb2c0bb7a72312cb6fe4ba6.zip |
Added second values to SVG.Number
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/number.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/spec/number.js b/spec/spec/number.js index 9ee3394..f35be5f 100644 --- a/spec/spec/number.js +++ b/spec/spec/number.js @@ -22,6 +22,11 @@ describe('Number', function() { expect(number.value).toBe(0.99) expect(number.unit).toBe('%') }) + it('parses a seconds value', function() { + number = new SVG.Number('2s') + expect(number.value).toBe(2000) + expect(number.unit).toBe('s') + }) it('parses a negative percent value', function() { number = new SVG.Number('-89%') expect(number.value).toBe(-0.89) @@ -55,6 +60,11 @@ describe('Number', function() { number.unit = '%' expect(number.toString()).toBe('136%') }) + it('converts second values properly', function() { + number.value = 2500 + number.unit = 's' + expect(number.toString()).toBe('2.5s') + }) }) describe('valueOf()', function() { |