aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-05-26 20:59:57 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-05-26 20:59:57 +0200
commit7990dc47fda4f3b850c18318775ab108c2aff8f5 (patch)
tree9a2ed0eba0a75765e20193e0f3b51d2286cddf62 /spec
parent07d1e87bb4843f954e9340a6206df34d294a847a (diff)
downloadsvg.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.js17
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)
+ })
+ })
+
})