diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2016-04-15 19:53:58 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2016-04-15 19:53:58 +0200 |
commit | 30df220d96e813e0dab08a08ebb00ba9cfa25352 (patch) | |
tree | ef3cfd57acf3a25e1d5aa3dddfd1c7cda3cda924 /spec | |
parent | bbea0c86882742f859bd133ad2c4a4d15dd9a172 (diff) | |
download | svg.js-30df220d96e813e0dab08a08ebb00ba9cfa25352.tar.gz svg.js-30df220d96e813e0dab08a08ebb00ba9cfa25352.zip |
fixed bug in `add()` and `SVG.Doc().create()`
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/doc.js | 20 | ||||
-rw-r--r-- | spec/spec/svg.js | 6 |
2 files changed, 19 insertions, 7 deletions
diff --git a/spec/spec/doc.js b/spec/spec/doc.js index 9696935..e25bd20 100644 --- a/spec/spec/doc.js +++ b/spec/spec/doc.js @@ -1,5 +1,13 @@ describe('Doc', function() { - + + describe('create()', function(){ + it('doenst alter size when adopting width SVG()', function() { + var svg = SVG('inlineSVG') + expect(svg.width()).toBe(0) + expect(svg.height()).toBe(0) + }) + }) + it('is an instance of SVG.Container', function() { expect(draw instanceof SVG.Container).toBe(true) }) @@ -7,11 +15,11 @@ describe('Doc', function() { it('is an instance of SVG.Doc', function() { expect(draw instanceof SVG.Doc).toBe(true) }) - + it('returns itself as Doc', function() { expect(draw.doc()).toBe(draw) }) - + it('has a defs element', function() { expect(draw.defs() instanceof SVG.Defs).toBe(true) }) @@ -24,7 +32,7 @@ describe('Doc', function() { expect(draw.defs().parent()).toBe(draw) }) }) - + describe('remove()', function() { it('removes the doc from the dom', function() { draw.remove() @@ -33,5 +41,5 @@ describe('Doc', function() { expect(document.getElementsByTagName('body')[0].querySelectorAll('svg').length).toBe(3) }) }) - -})
\ No newline at end of file + +}) diff --git a/spec/spec/svg.js b/spec/spec/svg.js index cc9f7be..63df0b9 100644 --- a/spec/spec/svg.js +++ b/spec/spec/svg.js @@ -19,6 +19,10 @@ describe('SVG', function() { it('creates an instance of SVG.Doc', function() { expect(drawing instanceof SVG.Doc).toBe(true) }) + it('sets size to 100%', function() { + expect(drawing.width()).toBe('100%') + expect(drawing.height()).toBe('100%') + }) }) describe('create()', function() { @@ -66,7 +70,7 @@ describe('SVG', function() { expect(typeof SVG.Path.prototype.soft).toBe('function') expect(draw.path().soft().attr('opacity')).toBe(0.5) }) - it('ignones non existant objects', function() { + it('ignores non existant objects', function() { SVG.extend(SVG.Rect, SVG.Bogus, { soft: function() { return this.opacity(0.3) |