Skip to content

Commit 1f724ad

Browse files
committed
Draggable Tests: don't test auto scroll while testing helpers.
1 parent ffab89e commit 1f724ad

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

tests/unit/draggable/draggable_options.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -676,19 +676,20 @@ test( "helper, default, switching after initialization", function() {
676676
"parent and root": [ "#main", document ],
677677
"grandparent": [ "#scrollParent" ]
678678
},
679-
positions = [ "absolute", "fixed", "relative" ],
679+
positions = [ "absolute", "fixed", "relative", "static" ],
680680
helpers = [ "original", "clone" ],
681-
scrollPositions = [ "relative", "static", "absolute" ];
681+
scrollPositions = [ "relative", "static", "absolute", "fixed" ];
682682

683683
for ( m = 0 ; m < helpers.length; m++ ) {
684684
for ( l = 0; l < positions.length; l++ ) {
685685
for ( k in scrollElements ) {
686686
(function( position, helper, scrollElements, scrollElementsTitle ){
687687
test( "{ helper: '" + helper + "' }, " + position + ", with scroll offset on " + scrollElementsTitle, function() {
688-
expect( 6 );
688+
expect( 8 );
689689
var i, j,
690690
element = $( "#draggable1" ).css({ position: position, top: 0, left: 0 }).draggable({
691-
helper: helper
691+
helper: helper,
692+
scroll: false
692693
});
693694

694695
if ( scrollElements.length === 1 && scrollElements[ 1 ] === "#scrollParent" ) {

tests/unit/draggable/draggable_test_helpers.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ TestHelpers.draggable = {
3030

3131
$( handle ).simulate( "drag", {
3232
dx: dx,
33-
dy: dy,
34-
// moves is 1 here because simulate currently fire events synchronously
35-
// so we can't faithfully test things that rely on a scroll event (which is async)
36-
moves: 1
33+
dy: dy
3734
});
3835
},
3936
shouldMovePositionButNotOffset: function( el, msg, handle ) {
@@ -43,10 +40,7 @@ TestHelpers.draggable = {
4340

4441
$( handle ).simulate( "drag", {
4542
dx: 100,
46-
dy: 100,
47-
// moves is 1 here because simulate currently fire events synchronously
48-
// so we can't faithfully test things that rely on a scroll event (which is async)
49-
moves: 1
43+
dy: 100
5044
});
5145
},
5246
shouldMove: function( el, msg, handle ) {

0 commit comments

Comments
 (0)