- Testing: Separate tests into unit/ui; split UI tests by specific domain;
setup browser-bug folder and ui issues folder - Testing: Create test utilities for selecting English and visiting and approving storage - Testing: Add test for tool selection
This commit is contained in:
19
cypress/integration/unit/sanitize.js
Normal file
19
cypress/integration/unit/sanitize.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import '../../../instrumented/jquery.min.js';
|
||||
|
||||
import {NS} from '../../../instrumented/namespaces.js';
|
||||
import * as sanitize from '../../../instrumented/sanitize.js';
|
||||
|
||||
describe('sanitize', function () {
|
||||
const svg = document.createElementNS(NS.SVG, 'svg');
|
||||
|
||||
it('Test sanitizeSvg() strips ws from style attr', function () {
|
||||
const rect = document.createElementNS(NS.SVG, 'rect');
|
||||
rect.setAttribute('style', 'stroke: blue ;\t\tstroke-width :\t\t40;');
|
||||
// sanitizeSvg() requires the node to have a parent and a document.
|
||||
svg.append(rect);
|
||||
sanitize.sanitizeSvg(rect);
|
||||
|
||||
assert.equal(rect.getAttribute('stroke'), 'blue');
|
||||
assert.equal(rect.getAttribute('stroke-width'), '40');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user