- 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:
Brett Zamir
2018-05-15 23:16:28 +08:00
parent 15331535f8
commit f7bdf6be18
34 changed files with 4062 additions and 4058 deletions

View File

@@ -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>