aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authordotnetCarpenter <jon.ronnenberg@gmail.com>2016-10-20 17:38:15 -0200
committerdotnetCarpenter <jon.ronnenberg@gmail.com>2016-10-20 17:47:40 -0200
commite4bff8c910e37f923a138fd44f6c8a3b21fa2a78 (patch)
treeb4744cfa0bb74e96e2efadf923da51eb7940d089 /spec
parent288662d0d9152602756b82f20798df9f47329bca (diff)
downloadsvg.js-e4bff8c910e37f923a138fd44f6c8a3b21fa2a78.tar.gz
svg.js-e4bff8c910e37f923a138fd44f6c8a3b21fa2a78.zip
added test for silently fixing wrong point parameters to SVG.PointArray + better descriptions for SVG.PointArray tests
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/array.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/spec/array.js b/spec/spec/array.js
index 1671ce8..69ee8ad 100644
--- a/spec/spec/array.js
+++ b/spec/spec/array.js
@@ -46,7 +46,14 @@ describe('PointArray', function () {
it('parses points with space delimitered x/y coordinates - even with leading or trailing space', function() {
var array = new SVG.PointArray(' 1 2 3 4 ')
- expect(array + '').toBe('1,2,3,4')
+ expect(array + '').toBe('1,2 3,4')
+ })
+ it('parses odd number of points with space delimitered x/y coordinates and silently remove the odd point', function() {
+ // this is according to spec: https://svgwg.org/svg2-draft/shapes.html#DataTypePoints
+
+ var array = new SVG.PointArray('1 2 3')
+
+ expect(array + '').toBe('1,2')
})
})