summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-02-03 21:59:15 +0100
committerwout <wout@impinc.co.uk>2014-02-03 21:59:15 +0100
commit189f009dbb28525f3eb2c0bb7a72312cb6fe4ba6 (patch)
tree39728b3425c7906b772a84d46778d33e34770ddf /spec
parent8dcb37d3406a85ef639e31b256823cf24fd7b7c6 (diff)
downloadsvg.js-189f009dbb28525f3eb2c0bb7a72312cb6fe4ba6.tar.gz
svg.js-189f009dbb28525f3eb2c0bb7a72312cb6fe4ba6.zip
Added second values to SVG.Number
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/number.js10
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() {