cypress 10 migration (#777)

* cypress 10 migration

* fix lint
This commit is contained in:
JFH
2022-06-18 10:32:27 +02:00
committed by GitHub
parent 29103ddf86
commit 9e3a4a9091
56 changed files with 3955 additions and 107 deletions

View File

@@ -0,0 +1,17 @@
import { NS } from '../../../instrumented/svgcanvas/namespaces.js'
import * as sanitize from '../../../instrumented/svgcanvas/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')
})
})