aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2023-09-03 12:20:46 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2023-09-03 12:20:46 +0200
commite70cdef7a5a21eda34f5f90260f9fd26099d274e (patch)
tree9e86cff57984c7badcde26de8098b7e0607d738f /spec
parent9718677bcdec90f5587ef09322428720e4d4b9c9 (diff)
downloadsvg.js-e70cdef7a5a21eda34f5f90260f9fd26099d274e.tar.gz
svg.js-e70cdef7a5a21eda34f5f90260f9fd26099d274e.zip
fix css, dont throw when screenCtm fails (fixes #968)
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/types/Matrix.js5
-rw-r--r--spec/spec/utils/utils.js17
2 files changed, 5 insertions, 17 deletions
diff --git a/spec/spec/types/Matrix.js b/spec/spec/types/Matrix.js
index f395c43..36882a9 100644
--- a/spec/spec/types/Matrix.js
+++ b/spec/spec/types/Matrix.js
@@ -594,6 +594,11 @@ describe('Matrix.js', () => {
svg.screenCTM()
expect(spy).toHaveBeenCalled()
})
+
+ it('does not throw and returns identity matrix if element is not rendered', () => {
+ const canvas = SVG().viewbox(0, 0, 0, 0)
+ expect(canvas.screenCTM()).toEqual(new Matrix())
+ })
})
})
})
diff --git a/spec/spec/utils/utils.js b/spec/spec/utils/utils.js
index 0b3015e..314c757 100644
--- a/spec/spec/utils/utils.js
+++ b/spec/spec/utils/utils.js
@@ -5,7 +5,6 @@ import {
filter,
radians,
degrees,
- camelCase,
unCamelCase,
capitalize,
proportionalSize,
@@ -81,22 +80,6 @@ describe('utils.js', function () {
})
})
- describe('camelCase()', function () {
- it('converts dash-case and PascalCase to camelCase', function () {
- var dash1 = 'dash-1'
- var dashTwo = 'dash-two'
- var camelOne = 'camelOne'
- var pascalOne = 'PascalOne'
- var mixOne = 'mix-One'
-
- expect(camelCase(dash1)).toBe('dash1')
- expect(camelCase(dashTwo)).toBe('dashTwo')
- expect(camelCase(camelOne)).toBe('camelone')
- expect(camelCase(pascalOne)).toBe('pascalone')
- expect(camelCase(mixOne)).toBe('mixOne')
- })
- })
-
describe('unCamelCase()', function () {
it('converts camelCase to dash-case', function () {
var dash1 = 'dash-1'