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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user