From 67fd40eda7a7f4a9e48afe09593c20bd0e0f9c6f Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Sat, 19 Oct 2013 11:12:35 -0400 Subject: Tests: extract TestHelpers.forceScrollableWindow for tests that need the window to scroll --- tests/unit/draggable/draggable_core.js | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'tests/unit/draggable') diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js index 0389ea9ee..5f1e173bf 100644 --- a/tests/unit/draggable/draggable_core.js +++ b/tests/unit/draggable/draggable_core.js @@ -118,14 +118,11 @@ test( "#6258: not following mouse when scrolled and using overflow-y: scroll", f .scrollLeft( 0 ); } }), - contentToForceScroll = $( "
" ).css({ - height: "10000px", - width: "10000px" - }), oldOverflowY = $( "html" ).css( "overflow-y" ), oldOverflowX = $( "html" ).css( "overflow-x" ); - contentToForceScroll.appendTo( "#qunit-fixture" ); + TestHelpers.forceScrollableWindow(); + $( "html" ) .css( "overflow-y", "scroll" ) .css( "overflow-x", "scroll" ) @@ -148,13 +145,10 @@ test( "#9315: Draggable: jumps down with offset of scrollbar", function() { equal( ui.position.top, 11, "top position is correct when position is absolute" ); $( "html" ).scrollTop( 0 ).scrollLeft( 0 ); } - }), - contentToForceScroll = $( "
" ).css({ - height: "10000px", - width: "10000px" }); - contentToForceScroll.appendTo( "#qunit-fixture" ); + TestHelpers.forceScrollableWindow(); + $( "html" ).scrollTop( 300 ).scrollLeft( 300 ); element.simulate( "drag", { @@ -178,13 +172,11 @@ test( "#5009: scroll not working with parent's position fixed", function() { equal( ui.position.top, 10, "top position is correct when parent position is fixed" ); $( document ).scrollTop( 0 ).scrollLeft( 0 ); } - }), - contentToForceScroll = $( "
" ).css({ - height: "20000px", - width: "20000px" }); - $( "#qunit-fixture" ).append( contentToForceScroll ); + + TestHelpers.forceScrollableWindow(); + $( "#wrapper" ).css( "position", "fixed" ); element.simulate( "drag", { -- cgit v1.2.3