(
assert,
addScriptAttribute,
setup,
onload
)
| 48 | } |
| 49 | |
| 50 | function loadDOMPurifyWithSanityCheck( |
| 51 | assert, |
| 52 | addScriptAttribute, |
| 53 | setup, |
| 54 | onload |
| 55 | ) { |
| 56 | const beforeOnLoadSanityCheck = function (window) { |
| 57 | assert.equal( |
| 58 | window.DOMPurify.sanitize('<img src=x onerror=alert(1)>'), |
| 59 | '<img src="x">' |
| 60 | ); |
| 61 | }; |
| 62 | loadDOMPurify( |
| 63 | assert, |
| 64 | addScriptAttribute, |
| 65 | setup, |
| 66 | beforeOnLoadSanityCheck, |
| 67 | onload |
| 68 | ); |
| 69 | } |
| 70 | |
| 71 | QUnit.test( |
| 72 | 'sanity check: works in a non-Trusted Type environment', |
no test coverage detected