Skip to content

Commit

Permalink
Manipulation: Generalize a test to support IE
Browse files Browse the repository at this point in the history
Ref gh-5378
Closes gh-5391
  • Loading branch information
gibson042 authored Jan 12, 2024
1 parent e06ff08 commit 88690eb
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions test/unit/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1826,11 +1826,25 @@ QUnit.test( "html(self-removing script) (gh-5377)", function( assert ) {

$fixture.html(
[
"<script>document.currentScript.parentNode.removeChild( document.currentScript ); QUnit.assert.ok( true, 'removed document.currentScript' );</script>",
"<script id='gh5377-1'>",
"(function removeScript() {",
"var id = 'gh5377-1';",
"var script = document.currentScript || document.getElementById(id);",
"script.parentNode.removeChild( script );",
"QUnit.assert.ok( true, 'removed document.currentScript' );",
"})();",
"</script>",
"<div>",
"<script>document.currentScript.parentNode.removeChild( document.currentScript ); QUnit.assert.ok( true, 'removed inner document.currentScript' );</script>",
"<script id='gh5377-2'>",
"(function removeInnerScript() {",
"var id = 'gh5377-2';",
"var innerScript = document.currentScript || document.getElementById(id);",
"innerScript.parentNode.removeChild( innerScript );",
"QUnit.assert.ok( true, 'removed inner document.currentScript' );",
"})();",
"</script>",
"</div>"
].join( "" )
].join( "\n" )
);
} );

Expand Down

0 comments on commit 88690eb

Please sign in to comment.