@@ -227,11 +227,36 @@ test("#4752: link event firing on sortable with connect list", function () {
227
227
test("receive", function() {
228
228
ok(false, "missing test - untested code is broken code.");
229
229
});
230
+ */
230
231
231
232
test ( "remove" , function ( ) {
232
- ok(false, "missing test - untested code is broken code.");
233
+ expect ( 8 ) ;
234
+
235
+ var hash ,
236
+ removeCount = 0 ,
237
+ item = $ ( "#sortable" ) . find ( "li:last" ) ;
238
+
239
+ $ ( ".connectWith" ) . sortable ( {
240
+ connectWith : ".connectWith" ,
241
+ remove : function ( e , ui ) {
242
+ hash = ui ;
243
+ removeCount ++ ;
244
+ }
245
+ } ) ;
246
+
247
+ item . simulate ( "drag" , {
248
+ dy : 40
249
+ } ) ;
250
+
251
+ ok ( hash , "remove event triggered" ) ;
252
+ ok ( ! hash . helper , "UI should not include: helper" ) ;
253
+ ok ( hash . placeholder , "UI hash includes: placeholder" ) ;
254
+ ok ( hash . position && ( "top" in hash . position && "left" in hash . position ) , "UI hash includes: position" ) ;
255
+ ok ( hash . offset && ( hash . offset . top && hash . offset . left ) , "UI hash includes: offset" ) ;
256
+ equal ( hash . item . html ( ) , item . html ( ) , "UI hash includes: item" ) ;
257
+ equal ( hash . sender . html ( ) , $ ( "#sortable" ) . html ( ) , "UI hash includes: sender" ) ;
258
+ equal ( removeCount , 1 , "remove fires only once" ) ;
233
259
} ) ;
234
- */
235
260
236
261
test ( "over" , function ( ) {
237
262
expect ( 8 ) ;
0 commit comments