summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-11-13 18:48:20 +0100
committerGitHub <noreply@github.com>2018-11-13 18:48:20 +0100
commit05ba3ddc990e6d22d1bac7e23b72613a355287bc (patch)
tree3dd6651c1afa6a6355d3a642dd8e3b58dc6173d4 /spec
parentf066d113ee0f50a4d1b795307bd4b2606ea427b3 (diff)
parent4c6ee6e25a68625fe7b0941db28681a69f1ce44a (diff)
downloadsvg.js-05ba3ddc990e6d22d1bac7e23b72613a355287bc.tar.gz
svg.js-05ba3ddc990e6d22d1bac7e23b72613a355287bc.zip
Merge pull request #928 from NorbertB29/fix/node_document_fragment_type
Add unit tests for document-fragment fix
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/doc.js8
-rw-r--r--spec/spec/element.js5
2 files changed, 13 insertions, 0 deletions
diff --git a/spec/spec/doc.js b/spec/spec/doc.js
index bec6fb4..1b47717 100644
--- a/spec/spec/doc.js
+++ b/spec/spec/doc.js
@@ -63,4 +63,12 @@ describe('Doc', function() {
})
})
+ describe('parent()', function () {
+ it('returns null if nodeName is document-fragment', function() {
+ var fragment = document.createDocumentFragment();
+ var svgFrag = new SVG(fragment);
+ expect(svgFrag.parent()).toBe(null);
+ })
+ })
+
})
diff --git a/spec/spec/element.js b/spec/spec/element.js
index 8f82e3c..a5b3ba1 100644
--- a/spec/spec/element.js
+++ b/spec/spec/element.js
@@ -635,6 +635,11 @@ describe('Element', function() {
var g = new SVG.G()
expect(new SVG.Rect().addTo(g).parent()).toBe(g)
})
+ it('returns null if nodeName is document-fragment', function() {
+ var fragment = document.createDocumentFragment();
+ var svgFrag = new SVG(fragment);
+ expect(svgFrag.parent()).toBe(null);
+ })
})
describe('parents()', function() {