Tests: Fix the "outside view position" test in Headless Chrome

In Headless Chrome, when run locally on macOS together with a few other modules,
the scroll handler for the appended element in the "outside view position"
dimensions test doesn't fire, timing out the test & failing it as a result.

While the scroll handler may not fire, the new position data is available
immediately, so just do the checks directly, without relying on scroll handlers.

Closes gh-5728
Ref gh-5729
This commit is contained in:
Michał Gołębiowski-Owczarek 2025-11-24 18:25:00 +01:00 committed by GitHub
parent 9572ae8a64
commit 23d72cb1db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -637,7 +637,7 @@ QUnit.test( "outside view position (gh-2836)", function( assert ) {
// This test ported from gh-2836 example
assert.expect( 1 );
var parent,
var parent, pos,
html = [
"<div id=div-gh-2836>",
"<div></div>",
@ -646,20 +646,15 @@ QUnit.test( "outside view position (gh-2836)", function( assert ) {
"<div></div>",
"<div></div>",
"</div>"
].join( "" ),
stop = assert.async();
].join( "" );
parent = jQuery( html );
parent.appendTo( "#qunit-fixture" );
parent.one( "scroll", function() {
var pos = parent.find( "div" ).eq( 3 ).position();
assert.strictEqual( pos.top, -100 );
stop();
} );
parent.scrollTop( 400 );
pos = parent.find( "div" ).eq( 3 ).position();
assert.strictEqual( pos.top, -100 );
} );
QUnit.test( "width/height on element with transform (gh-3193)", function( assert ) {