aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/sortable
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/sortable')
-rw-r--r--tests/unit/sortable/core.js6
-rw-r--r--tests/unit/sortable/events.js30
-rw-r--r--tests/unit/sortable/options.js4
3 files changed, 20 insertions, 20 deletions
diff --git a/tests/unit/sortable/core.js b/tests/unit/sortable/core.js
index 2bb11edbe..b434e96f0 100644
--- a/tests/unit/sortable/core.js
+++ b/tests/unit/sortable/core.js
@@ -24,8 +24,8 @@ QUnit.test( "ui-sortable-handle applied to appropriate element", function( asser
.sortable()
.appendTo( "#qunit-fixture" );
- assert.hasClasses( el.find( "li:first" ), "ui-sortable-handle" );
- assert.hasClasses( el.find( "li:last" ), "ui-sortable-handle" );
+ assert.hasClasses( el.find( "li" ).first(), "ui-sortable-handle" );
+ assert.hasClasses( el.find( "li" ).last(), "ui-sortable-handle" );
el.sortable( "option", "handle", "p" );
assert.lacksClasses( el.find( "li" )[ 0 ], "ui-sortable-handle" );
@@ -34,7 +34,7 @@ QUnit.test( "ui-sortable-handle applied to appropriate element", function( asser
assert.hasClasses( el.find( "p" )[ 1 ], "ui-sortable-handle" );
el.append( item ).sortable( "refresh" );
- assert.hasClasses( el.find( "p:last" ), "ui-sortable-handle" );
+ assert.hasClasses( el.find( "p" ).last(), "ui-sortable-handle" );
el.sortable( "destroy" );
assert.equal( el.find( ".ui-sortable-handle" ).length, 0, "class name removed on destroy" );
diff --git a/tests/unit/sortable/events.js b/tests/unit/sortable/events.js
index 4973abef0..9df830e16 100644
--- a/tests/unit/sortable/events.js
+++ b/tests/unit/sortable/events.js
@@ -16,7 +16,7 @@ QUnit.test( "start", function( assert ) {
start: function( e, ui ) {
hash = ui;
}
- } ).find( "li:eq(0)" ).simulate( "drag", {
+ } ).find( "li" ).eq( 0 ).simulate( "drag", {
dy: 10
} );
@@ -39,7 +39,7 @@ QUnit.test( "sort", function( assert ) {
sort: function( e, ui ) {
hash = ui;
}
- } ).find( "li:eq(0)" ).simulate( "drag", {
+ } ).find( "li" ).eq( 0 ).simulate( "drag", {
dy: 10
} );
@@ -61,7 +61,7 @@ QUnit.test( "change", function( assert ) {
change: function( e, ui ) {
hash = ui;
}
- } ).find( "li:eq(0)" ).simulate( "drag", {
+ } ).find( "li" ).eq( 0 ).simulate( "drag", {
dx: 1,
dy: 1
} );
@@ -72,7 +72,7 @@ QUnit.test( "change", function( assert ) {
change: function( e, ui ) {
hash = ui;
}
- } ).find( "li:eq(0)" ).simulate( "drag", {
+ } ).find( "li" ).eq( 0 ).simulate( "drag", {
dy: 22
} );
@@ -94,7 +94,7 @@ QUnit.test( "beforeStop", function( assert ) {
beforeStop: function( e, ui ) {
hash = ui;
}
- } ).find( "li:eq(0)" ).simulate( "drag", {
+ } ).find( "li" ).eq( 0 ).simulate( "drag", {
dy: 20
} );
@@ -116,7 +116,7 @@ QUnit.test( "stop", function( assert ) {
stop: function( e, ui ) {
hash = ui;
}
- } ).find( "li:eq(0)" ).simulate( "drag", {
+ } ).find( "li" ).eq( 0 ).simulate( "drag", {
dy: 20
} );
@@ -138,7 +138,7 @@ QUnit.test( "update", function( assert ) {
update: function( e, ui ) {
hash = ui;
}
- } ).find( "li:eq(0)" ).simulate( "drag", {
+ } ).find( "li" ).eq( 0 ).simulate( "drag", {
dx: 1,
dy: 1
} );
@@ -149,7 +149,7 @@ QUnit.test( "update", function( assert ) {
update: function( e, ui ) {
hash = ui;
}
- } ).find( "li:eq(0)" ).simulate( "drag", {
+ } ).find( "li" ).eq( 0 ).simulate( "drag", {
dy: 22
} );
@@ -203,13 +203,13 @@ QUnit.test( "#4752: link event firing on sortable with connect list", function(
fired.click = true;
} );
- $( "#sortable li:eq(0)" ).simulate( "click" );
+ $( "#sortable li" ).eq( 0 ).simulate( "click" );
assert.ok( !hasFired( "change" ), "Click only, change event should not have fired" );
assert.ok( hasFired( "click" ), "Click event should have fired" );
// Drag an item within the first list
fired = {};
- $( "#sortable li:eq(0)" ).simulate( "drag", { dx: 0, dy: 40 } );
+ $( "#sortable li" ).eq( 0 ).simulate( "drag", { dx: 0, dy: 40 } );
assert.ok( hasFired( "change" ), "40px drag, change event should have fired" );
assert.ok( !hasFired( "receive" ), "Receive event should not have fired" );
assert.ok( !hasFired( "remove" ), "Remove event should not have fired" );
@@ -217,7 +217,7 @@ QUnit.test( "#4752: link event firing on sortable with connect list", function(
// Drag an item from the first list to the second, connected list
fired = {};
- $( "#sortable li:eq(0)" ).simulate( "drag", { dx: 0, dy: 150 } );
+ $( "#sortable li" ).eq( 0 ).simulate( "drag", { dx: 0, dy: 150 } );
assert.ok( hasFired( "change" ), "150px drag, change event should have fired" );
assert.ok( hasFired( "receive" ), "Receive event should have fired" );
assert.ok( hasFired( "remove" ), "Remove event should have fired" );
@@ -245,7 +245,7 @@ QUnit.test( "over", function( assert ) {
hash = ui;
overCount++;
}
- } ).find( "li:eq(0)" ).simulate( "drag", {
+ } ).find( "li" ).eq( 0 ).simulate( "drag", {
dy: 20
} );
@@ -301,7 +301,7 @@ QUnit.test( "over, with connected sortable", function( assert ) {
hash = ui;
overCount++;
} );
- $( "#sortable" ).find( "li:eq(0)" ).simulate( "drag", {
+ $( "#sortable" ).find( "li" ).eq( 0 ).simulate( "drag", {
dy: 102
} );
@@ -329,7 +329,7 @@ QUnit.test( "out, with connected sortable", function( assert ) {
hash = ui;
outCount++;
} );
- $( "#sortable" ).find( "li:last" ).simulate( "drag", {
+ $( "#sortable" ).find( "li" ).last().simulate( "drag", {
dy: 40
} );
@@ -357,7 +357,7 @@ QUnit.test( "repeated out & over between connected sortables", function( assert
}
}
} );
- $( "#sortable" ).find( "li:last" ).simulate( "drag", {
+ $( "#sortable" ).find( "li" ).last().simulate( "drag", {
dy: 40
} ).simulate( "drag", {
dy: -40
diff --git a/tests/unit/sortable/options.js b/tests/unit/sortable/options.js
index 30929a501..d157d2b77 100644
--- a/tests/unit/sortable/options.js
+++ b/tests/unit/sortable/options.js
@@ -136,7 +136,7 @@ QUnit.test( "#8792: issues with floated items in connected lists", function( ass
}
} );
- element = $( "#qunit-fixture li:eq(0)" );
+ element = $( "#qunit-fixture li" ).eq( 0 );
// Move the first li to the right of the second li in the first ul
element.simulate( "drag", {
@@ -447,7 +447,7 @@ QUnit.test( "{ placholder: String } tbody", function( assert ) {
assert.equal( ui.placeholder.children( "tr" ).length, 1,
"placeholder's child is tr" );
assert.equal( ui.placeholder.find( "> tr" ).children().length,
- dragBody.find( "> tr:first" ).children().length,
+ dragBody.find( "> tr" ).first().children().length,
"placeholder's tr has correct number of cells" );
assert.equal( ui.placeholder.find( "> tr" ).children().html(),
$( "<span>&#160;</span>" ).html(),