From 2469505b1bd2cb69930391c90efe33902db2dd6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20G=C3=A9rardy?= Date: Thu, 31 May 2018 16:54:44 +0200 Subject: [PATCH] Move xlink:href test to the proper file --- render/tests/test-attributes.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/render/tests/test-attributes.js b/render/tests/test-attributes.js index 8059e887..379939e9 100644 --- a/render/tests/test-attributes.js +++ b/render/tests/test-attributes.js @@ -349,7 +349,7 @@ o.spec("attributes", function() { o(canvas.dom.width).equals(100) }) }) - o.spec("svg class", function() { + o.spec("svg", function() { o("when className is specified then it should be added as a class", function() { var a = {tag: "svg", attrs: {className: "test"}} @@ -357,7 +357,26 @@ o.spec("attributes", function() { o(a.dom.attributes["class"].value).equals("test") }) + o("removes xlink:href", function() { + var vnode = {tag: "svg", ns: "http://www.w3.org/2000/svg", children: [ + {tag: "a", ns: "http://www.w3.org/2000/svg", attrs: {"xlink:href": "javascript:;"}} + ]} + render(root, [vnode]) + + o(vnode.dom.nodeName).equals("svg") + o(vnode.dom.firstChild.attributes["xlink:href"].value).equals("javascript:;") + o(vnode.dom.firstChild.attributes["xlink:href"].namespaceURI).equals("http://www.w3.org/1999/xlink") + + vnode = {tag: "svg", ns: "http://www.w3.org/2000/svg", children: [ + {tag: "a", ns: "http://www.w3.org/2000/svg", attrs: {}} + ]} + render(root, [vnode]) + + o(vnode.dom.nodeName).equals("svg") + o(vnode.dom.firstChild.attributes["xlink:href"]).equals(undefined) + }) }) + o.spec("option.value", function() { o("can be set as text", function() { var a = {tag: "option", attrs: {value: "test"}}