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"}}