- Testing (math_test): Fix undeclared variables
- Testing: Move JavaScript out of HTML to own files - Linting: ESLint; unfinished: editor/extensions/, editor/ (root); some of test
This commit is contained in:
@@ -11,32 +11,7 @@
|
||||
<script src="../editor/svgutils.js"></script>
|
||||
<script src="../editor/sanitize.js"></script>
|
||||
<script src="qunit/qunit.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
// log function
|
||||
QUnit.log = function(details) {
|
||||
if (window.console && window.console.log) {
|
||||
window.console.log(details.result +' :: '+ details.message);
|
||||
}
|
||||
};
|
||||
|
||||
var svg = document.createElementNS(svgedit.NS.SVG, 'svg');
|
||||
|
||||
test('Test sanitizeSvg() strips ws from style attr', function() {
|
||||
expect(2);
|
||||
|
||||
var rect = document.createElementNS(svgedit.NS.SVG, 'rect');
|
||||
rect.setAttribute('style', 'stroke: blue ; stroke-width : 40;');
|
||||
// sanitizeSvg() requires the node to have a parent and a document.
|
||||
svg.appendChild(rect);
|
||||
svgedit.sanitize.sanitizeSvg(rect);
|
||||
|
||||
equals(rect.getAttribute('stroke'), 'blue');
|
||||
equals(rect.getAttribute('stroke-width'), '40');
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<script src="sanitize_test.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="qunit-header">Unit Tests for sanitize.js</h1>
|
||||
|
||||
Reference in New Issue
Block a user