Skip to content

Commit

Permalink
Merge pull request #629 from is2ei/run-format
Browse files Browse the repository at this point in the history
chore: run format
  • Loading branch information
cure53 committed Jan 23, 2022
2 parents dad9227 + 6fa4888 commit 9e42e20
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions test/test-suite.js
Expand Up @@ -511,18 +511,28 @@ module.exports = function (DOMPurify, window, tests, xssTests) {
assert.equal(dirty, clean); // should return the input node
assert.equal(dirty.href, ''); // should still sanitize
});
QUnit.test('Config-Flag tests: IN_PLACE insecure root-nodes', function (assert) {
//IN_PLACE with insecure root node (script)
var dirty = document.createElement('script');
dirty.setAttribute('src', 'data:,alert(1)');
assert.throws(function(){DOMPurify.sanitize(dirty, { IN_PLACE: true })});
});
QUnit.test('Config-Flag tests: IN_PLACE insecure root-nodes', function (assert) {
//IN_PLACE with insecure root node (iframe)
var dirty = document.createElement('iframe');
dirty.setAttribute('src', 'javascript:alert(1)');
assert.throws(function(){DOMPurify.sanitize(dirty, { IN_PLACE: true })});
});
QUnit.test(
'Config-Flag tests: IN_PLACE insecure root-nodes',
function (assert) {
//IN_PLACE with insecure root node (script)
var dirty = document.createElement('script');
dirty.setAttribute('src', 'data:,alert(1)');
assert.throws(function () {
DOMPurify.sanitize(dirty, { IN_PLACE: true });
});
}
);
QUnit.test(
'Config-Flag tests: IN_PLACE insecure root-nodes',
function (assert) {
//IN_PLACE with insecure root node (iframe)
var dirty = document.createElement('iframe');
dirty.setAttribute('src', 'javascript:alert(1)');
assert.throws(function () {
DOMPurify.sanitize(dirty, { IN_PLACE: true });
});
}
);
QUnit.test('Config-Flag tests: FORBID_TAGS', function (assert) {
//FORBID_TAGS
assert.equal(
Expand Down

0 comments on commit 9e42e20

Please sign in to comment.