Correct mime type on svgutils_test.html. Add test for svgedit.utilities.bboxToObj()

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1859 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2010-11-08 18:10:06 +00:00
parent f03a503d9a
commit 3a76f5e4d6
2 changed files with 21 additions and 9 deletions

View File

@ -16,6 +16,9 @@
}
};
var svgns = 'http://www.w3.org/2000/svg';
var svg = document.createElementNS(svgns, 'svg');
module('svgedit.utilities Module');
test('Test svgedit.utilities package', function() {
@ -70,6 +73,24 @@
equals(decode64('YH4hQCMkJV4mKigpLV89K1t7XX1cfDs6JyIsPC4+Lz8='), '`~!@#$%^&*()-_=+[{]}\\|;:\'",<.>/?');
});
test('Test svgedit.utilities.bboxToObj() function', function() {
expect(5);
var bboxToObj = svgedit.utilities.bboxToObj;
var rect = svg.createSVGRect();
rect.x = 1;
rect.y = 2;
rect.width = 3;
rect.height = 4;
var obj = bboxToObj(rect);
equals(typeof obj, typeof {});
equals(obj.x, 1);
equals(obj.y, 2);
equals(obj.width, 3);
equals(obj.height, 4);
});
});
</script>
</head>

View File

@ -241,15 +241,6 @@
equal(math.namespaceURI, "http://www.w3.org/1998/Math/MathML", "Preserved MathML namespace");
});
test("Test escaping XML entities", function() {
expect(3);
equal(svgCanvas.Utils.toXml("<"), "&lt;", "Escaped < properly");
equal(svgCanvas.Utils.toXml(">"), "&gt;", "Escaped > properly");
equal(svgCanvas.Utils.toXml("&"), "&amp;", "Escaped & properly");
// TODO: what about &quot; and &apos; ?
});
test("Test importing SVG into existing drawing", function() {
expect(3);