Skip to content

Commit 23d72cb

Browse files
authored
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
1 parent 9572ae8 commit 23d72cb

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

test/unit/dimensions.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ QUnit.test( "outside view position (gh-2836)", function( assert ) {
637637
// This test ported from gh-2836 example
638638
assert.expect( 1 );
639639

640-
var parent,
640+
var parent, pos,
641641
html = [
642642
"<div id=div-gh-2836>",
643643
"<div></div>",
@@ -646,20 +646,15 @@ QUnit.test( "outside view position (gh-2836)", function( assert ) {
646646
"<div></div>",
647647
"<div></div>",
648648
"</div>"
649-
].join( "" ),
650-
stop = assert.async();
649+
].join( "" );
651650

652651
parent = jQuery( html );
653652
parent.appendTo( "#qunit-fixture" );
654653

655-
parent.one( "scroll", function() {
656-
var pos = parent.find( "div" ).eq( 3 ).position();
657-
658-
assert.strictEqual( pos.top, -100 );
659-
stop();
660-
} );
661-
662654
parent.scrollTop( 400 );
655+
656+
pos = parent.find( "div" ).eq( 3 ).position();
657+
assert.strictEqual( pos.top, -100 );
663658
} );
664659

665660
QUnit.test( "width/height on element with transform (gh-3193)", function( assert ) {

0 commit comments

Comments
 (0)