diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-04-09 20:37:56 +1000 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-04-09 20:37:56 +1000 |
commit | 78d3ca83e3a7b74bdda246f78afdb26a19348668 (patch) | |
tree | 5031daf9ceb45a8b68aa3dedef19a1b29e839088 /spec | |
parent | 6a57b8cd9da1d0abc77b6ba4a2ce3d15fe675048 (diff) | |
download | svg.js-78d3ca83e3a7b74bdda246f78afdb26a19348668.tar.gz svg.js-78d3ca83e3a7b74bdda246f78afdb26a19348668.zip |
added tests for Defs
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/elements/Defs.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/spec/elements/Defs.js b/spec/spec/elements/Defs.js new file mode 100644 index 0000000..ef6c290 --- /dev/null +++ b/spec/spec/elements/Defs.js @@ -0,0 +1,31 @@ +/* globals describe, expect, it, jasmine */ + +import { Defs } from '../../../src/main.js' + +const { any } = jasmine + +describe('Defs.js', () => { + describe('()', () => { + it('creates a new object of type Defs', () => { + expect(new Defs()).toEqual(any(Defs)) + }) + + it('sets passed attributes on the element', () => { + expect(new Defs({ id: 'foo' }).id()).toBe('foo') + }) + }) + + describe('flatten()', () => { + it('does nothing and returns itself', () => { + const defs = Object.freeze(new Defs()) + expect(defs.flatten()).toBe(defs) + }) + }) + + describe('ungroup()', () => { + it('does nothing and returns itself', () => { + const defs = Object.freeze(new Defs()) + expect(defs.ungroup()).toBe(defs) + }) + }) +}) |