aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/offset.js
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2017-04-28 22:36:57 -0400
committerRichard Gibson <richard.gibson@gmail.com>2017-04-28 22:36:57 -0400
commitdd408ce12f789f46516be5409da4116c6408b756 (patch)
treed5da10920658a81003048cb9435d37e62b891d4b /test/unit/offset.js
parentcc73471d0759924aef3c1ba002d9bd1fee559b8e (diff)
downloadjquery-dd408ce12f789f46516be5409da4116c6408b756.tar.gz
jquery-dd408ce12f789f46516be5409da4116c6408b756.zip
Tests: Add debugging to investigate iOS failures
Ref 1d2df772b4d6e5dbf91df6e75f4a1809f7879ab0
Diffstat (limited to 'test/unit/offset.js')
-rw-r--r--test/unit/offset.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/test/unit/offset.js b/test/unit/offset.js
index d56930924..4f04d73af 100644
--- a/test/unit/offset.js
+++ b/test/unit/offset.js
@@ -38,7 +38,11 @@ var supportsFixedPosition, supportsScroll, alwaysScrollable,
alwaysScrollable = win.pageXOffset !== 0;
done();
},
- function( _, mockTest ) { mockTest( assert ); }
+ function mockQUnit_test( _, testCallback ) {
+ setTimeout( function() {
+ testCallback( assert );
+ } );
+ }
);
};
@@ -665,13 +669,29 @@ QUnit.test( "chaining", function( assert ) {
// Define expectations at runtime so alwaysScrollable is correct
expectations = getExpectations( htmlPos, bodyPos );
- assert.expect( 3 * Object.keys( expectations ).length );
+ assert.expect( 1 + 3 * Object.keys( expectations ).length );
// Setup documentElement and body styles, preserving scroll position
doc.documentElement.style.position = htmlPos;
doc.body.style.position = bodyPos;
win.scrollTo( scrollLeft, scrollTop );
+ // Try to figure out what is happening in TestSwarm
+ var fixed = $( "#fixed" )[ 0 ],
+ fixedStyle = win.getComputedStyle( fixed ),
+ fixedRect = fixed.getBoundingClientRect();
+ assert.ok( "CI debug", JSON.stringify(
+ {
+ alwaysScrollable: alwaysScrollable,
+ "original scroll": [ scrollTop, scrollLeft ],
+ "scroll": [ win.pageYOffset, win.pageXOffset ],
+ "#fixed pos": fixedStyle.position,
+ "#fixed viewport rect": [ fixedRect.top, fixedRect.left ]
+ },
+ null,
+ " "
+ ) );
+
// Verify expected document offset
supportjQuery.each( expectations, function( id, descriptor ) {
assert.deepEqual(