diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-05-26 20:59:57 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-05-26 20:59:57 +0200 |
commit | 7990dc47fda4f3b850c18318775ab108c2aff8f5 (patch) | |
tree | 9a2ed0eba0a75765e20193e0f3b51d2286cddf62 /spec | |
parent | 07d1e87bb4843f954e9340a6206df34d294a847a (diff) | |
download | svg.js-7990dc47fda4f3b850c18318775ab108c2aff8f5.tar.gz svg.js-7990dc47fda4f3b850c18318775ab108c2aff8f5.zip |
fixed issues in SVG.Doc and SVG.Mask when cloning(#782)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/doc.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/spec/doc.js b/spec/spec/doc.js index 17bcb28..bec6fb4 100644 --- a/spec/spec/doc.js +++ b/spec/spec/doc.js @@ -42,10 +42,25 @@ describe('Doc', function() { }else{ expect(window.document.querySelectorAll('svg').length).toBe(cnt-1) } - + draw = SVG(drawing).size(100,100); expect(window.document.querySelectorAll('svg').length).toBe(cnt) }) }) + describe('clone()', function () { + it('clones the doc and inserts the clone after the doc', function () { + var clone = draw.clone() + + expect(draw.node.nextSibling).toBe(clone.node) + clone.remove() + }) + it('clones the doc and inserts the clone in the provided parent', function () { + var el = document.createElement('div') + var clone = draw.clone(el) + + expect(clone.node.parentNode).toBe(el) + }) + }) + }) |