Add unit test for importing use. Add missing id attribute on use in whitelist

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1270 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Jeff Schiller
2010-01-21 14:12:08 +00:00
parent c8e0a94d50
commit 86ac38547f
2 changed files with 21 additions and 3 deletions

View File

@@ -63,6 +63,24 @@
"Expected identity matrix when multiplying a matrix by its inverse, got " + matrixString(I));
});
module("Import Module");
test("Test import use", function() {
expect(2);
svgCanvas.setSvgString("<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='400' x='300'>" +
"<rect id='the-rect' width='200' height='200'/>" +
"<use id='the-use' xlink:href='#the-rect'/>" +
"<use id='foreign-use' xlink:href='somefile.svg#the-rect'/>" +
"</svg>");
var u = document.getElementById("the-use"),
fu = document.getElementById("foreign-use");
equals(true, (u && u.nodeName == "use"), "Did not import <use> element");
equals(null, fu, "Imported a <use> that references a foreign element");
});
});
</script>
</head>