summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-04-11 08:52:20 +0100
committerwout <wout@impinc.co.uk>2013-04-11 08:52:20 +0100
commitec833bcefe20bd51d128cd0978128a9c9a63a043 (patch)
tree2369300640e2bc4317bea0ca3b3849b3bb6b0871 /spec
parent0ec7b9bf96cdd3ad2aa72682d3781c0aa1c7c356 (diff)
downloadsvg.js-ec833bcefe20bd51d128cd0978128a9c9a63a043.tar.gz
svg.js-ec833bcefe20bd51d128cd0978128a9c9a63a043.zip
Fix for Firefox in bbox()0.13
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/text.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/spec/text.js b/spec/spec/text.js
index b1af24e..83fd23a 100644
--- a/spec/spec/text.js
+++ b/spec/spec/text.js
@@ -15,7 +15,7 @@ describe('Text', function() {
describe('x()', function() {
it('should return the value of x without an argument', function() {
- expect(text.x()).toBe(0)
+ expect(approximately(text.x())).toBe(approximately(0))
})
it('should set the value of x with the first argument', function() {
text.x(123)
@@ -48,17 +48,17 @@ describe('Text', function() {
describe('cx()', function() {
it('should return the value of cx without an argument', function() {
var box = text.bbox()
- expect(text.cx()).toBe(box.width / 2)
+ expect(approximately(text.cx())).toBe(approximately(box.width / 2))
})
it('should set the value of cx with the first argument', function() {
text.cx(123)
var box = text.bbox()
- expect(box.cx).toBe(123)
+ expect(approximately(box.cx)).toBe(approximately(123))
})
it('should set the value of cx based on the anchor with the first argument', function() {
text.cx(123, true)
var box = text.bbox()
- expect(box.cx).toBe(123)
+ expect(approximately(box.cx)).toBe(approximately(123))
})
})
@@ -91,7 +91,7 @@ describe('Text', function() {
it('should set the cx and cy position', function() {
text.center(321,567)
var box = text.bbox()
- expect(box.cx).toBe(321)
+ expect(approximately(box.cx)).toBe(approximately(321))
expect(approximately(box.cy)).toBe(approximately(567))
})
})