aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2016-10-12 14:48:28 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2016-10-12 14:48:28 +0200
commit0a857d505e69446fb1e841afaf3bb57ed23e5b63 (patch)
treea2359346fdd3881b6c04c5ee370703cbf7d79db3 /spec
parent018fcce752970fffd0ad0b7d1d79e6c66c70cdf0 (diff)
downloadsvg.js-0a857d505e69446fb1e841afaf3bb57ed23e5b63.tar.gz
svg.js-0a857d505e69446fb1e841afaf3bb57ed23e5b63.zip
fixed specs for SVG.Point, fixes #530
Diffstat (limited to 'spec')
-rw-r--r--spec/SpecRunner.html1
-rw-r--r--spec/spec/point.js16
2 files changed, 9 insertions, 8 deletions
diff --git a/spec/SpecRunner.html b/spec/SpecRunner.html
index 4f204a6..192aef1 100644
--- a/spec/SpecRunner.html
+++ b/spec/SpecRunner.html
@@ -58,6 +58,7 @@
<script src="spec/event.js"></script>
<script src="spec/boxes.js"></script>
<script src="spec/matrix.js"></script>
+ <script src="spec/point.js"></script>
<script src="spec/rect.js"></script>
<script src="spec/circle.js"></script>
<script src="spec/ellipse.js"></script>
diff --git a/spec/spec/point.js b/spec/spec/point.js
index ce28781..3cd0bdc 100644
--- a/spec/spec/point.js
+++ b/spec/spec/point.js
@@ -5,8 +5,8 @@ describe('Point', function() {
describe('without a source', function() {
- point(function() {
- matrix = new SVG.Point
+ beforeEach(function() {
+ point = new SVG.Point
})
it('creates a new point with default values', function() {
@@ -76,7 +76,7 @@ describe('Point', function() {
describe('morph()', function() {
it('stores a given point for morphing', function() {
var point1 = new SVG.Point(1,1)
- , point2 = new SVG.Matrix(2,2)
+ , point2 = new SVG.Point(2,2)
point1.morph(point2)
@@ -84,7 +84,7 @@ describe('Point', function() {
})
it('stores a clone, not the given matrix itself', function() {
var point1 = new SVG.Point(1,1)
- , point2 = new SVG.Matrix(2,2)
+ , point2 = new SVG.Point(2,2)
point1.morph(point2)
@@ -96,9 +96,9 @@ describe('Point', function() {
it('returns a morphed point at a given position', function() {
var point1 = new SVG.Point(1,1)
, point2 = new SVG.Point(2,2)
- , matrix3 = matrix1.morph(matrix2).at(0.5)
+ , point3 = point1.morph(point2).at(0.5)
- expect(matrix3).toEqual(new SVG.Point(1.5, 1.5))
+ expect(point3).toEqual(new SVG.Point(1.5, 1.5))
})
})
@@ -107,9 +107,9 @@ describe('Point', function() {
var point = new SVG.Point(1,5)
, matrix = new SVG.Matrix(0,0,1,0,0,1)
- expect(point.transform(matrox)).toEqual(new SVG.Point(5,1))
+ expect(point.transform(matrix)).toEqual(new SVG.Point(5,1))
})
- }
+ })
describe('native()', function() {
it('returns native SVGPoint', function() {