diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/types/Matrix.js | 5 | ||||
-rw-r--r-- | spec/spec/utils/utils.js | 17 |
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' |