Skip to content

Commit

Permalink
add another falsy argument case
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-atr committed Feb 9, 2022
1 parent f1cc121 commit 87b7eb8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/scriptlets/prevent-element-src-loading.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@ test('setAttribute, falsy arguments', (assert) => {
const node = document.createElement(targetNode);
node.setAttribute(null, undefined);
document.body.append(node);

assert.strictEqual(node.getAttribute('null'), 'undefined', 'falsy attr value passed');
node.remove();

const node2 = document.createElement(targetNode);
node2.setAttribute(null, 0);
document.body.append(node2);
assert.strictEqual(node2.getAttribute('null'), '0', 'falsy attr value passed');
node2.remove();

assert.strictEqual(window.hit, undefined, 'hit should NOT fire');
});

0 comments on commit 87b7eb8

Please sign in to comment.