Added test child script nodes evaluate when first child

This commit is contained in:
Ben Croker 2020-11-09 10:49:01 +01:00 committed by GitHub
parent 3e8c47df05
commit 28d47e91d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -563,6 +563,23 @@ describe("Core htmx AJAX Tests", function(){
}
});
it('child script nodes evaluate when first child', function()
{
var globalWasCalled = false;
window.callGlobal = function() {
globalWasCalled = true;
}
try {
this.server.respondWith("GET", "/test", "<script type='text/javascript'>callGlobal()</script><div></div>");
var div = make("<div hx-get='/test'></div>");
div.click();
this.server.respond();
globalWasCalled.should.equal(true);
} finally {
delete window.callGlobal;
}
});
it('child script nodes evaluate when not explicity marked javascript', function()
{
var globalWasCalled = false;