summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-07-26 09:17:34 +0100
committerwout <wout@impinc.co.uk>2013-07-26 09:17:34 +0100
commit21d6c0b30a530ce7746f789921c7135079f43338 (patch)
treee31f12819b83222cccdaaebbb171e800e97ffff5 /spec
parent0685d55d3125f212975807f540520cffb663d9a8 (diff)
downloadsvg.js-21d6c0b30a530ce7746f789921c7135079f43338.tar.gz
svg.js-21d6c0b30a530ce7746f789921c7135079f43338.zip
Added support for CommonJS and AMD, bunped to v0.300.31
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/number.js12
-rw-r--r--spec/spec/text.js2
2 files changed, 13 insertions, 1 deletions
diff --git a/spec/spec/number.js b/spec/spec/number.js
index 3d1876c..e6261d3 100644
--- a/spec/spec/number.js
+++ b/spec/spec/number.js
@@ -28,6 +28,18 @@ describe('Number', function() {
expect(number.value).toBe(-0.89)
expect(number.unit).toBe('%')
})
+ it('falls back to 0 if given value is NaN', function() {
+ number = new SVG.Number(NaN)
+ expect(number.value).toBe(0)
+ })
+ it('falls back to maximum value if given number is positive infinite', function() {
+ number = new SVG.Number(1.7976931348623157E+10308)
+ expect(number.value).toBe(Number.MAX_VALUE)
+ })
+ it('falls back to minimum value if given number is negative infinite', function() {
+ number = new SVG.Number(-1.7976931348623157E+10308)
+ expect(number.value).toBe(Number.MIN_VALUE)
+ })
})
diff --git a/spec/spec/text.js b/spec/spec/text.js
index 0d72a91..c98e4d5 100644
--- a/spec/spec/text.js
+++ b/spec/spec/text.js
@@ -99,7 +99,7 @@ describe('Text', function() {
describe('size()', function() {
it('should define the width and height of the element', function() {
text.size(50)
- expect(text.style('font-size')).toBe(50)
+ expect(text.style('font-size').valueOf()).toBe(50)
})
})