From 21d6c0b30a530ce7746f789921c7135079f43338 Mon Sep 17 00:00:00 2001 From: wout Date: Fri, 26 Jul 2013 09:17:34 +0100 Subject: Added support for CommonJS and AMD, bunped to v0.30 --- spec/spec/number.js | 12 ++++++++++++ spec/spec/text.js | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'spec') 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) }) }) -- cgit v1.2.3