mirror of
https://github.com/jquery/jquery.git
synced 2025-12-28 05:13:49 +00:00
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:
parent
9572ae8a64
commit
23d72cb1db
@ -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 ) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user