aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/manipulation.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index e197712fb..b40ba6056 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -1819,6 +1819,21 @@ QUnit.test( "html(script nomodule)", function( assert ) {
}, 1000 );
} );
+QUnit.test( "html(self-removing script) (gh-5377)", function( assert ) {
+ assert.expect( 2 );
+
+ var $fixture = jQuery( "#qunit-fixture" );
+
+ $fixture.html(
+ [
+ "<script>document.currentScript.parentNode.removeChild( document.currentScript ); 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>",
+ "</div>"
+ ].join( "" )
+ );
+} );
+
QUnit.test( "html(Function) with incoming value -- direct selection", function( assert ) {
assert.expect( 4 );