Debian Codegraph @

tests/unit/droppable/events.js

raw symbols SCIP
1 define( [
2 "qunit",
3 "jquery",
4 "lib/helper",
5 "ui/widgets/droppable"
6 ], function( QUnit, $, helper ) {
7 "use strict";
8
9 QUnit.module( "droppable: events", { afterEach: helper.moduleAfterEach } );
10
11 QUnit.test( "droppable destruction/recreation on drop event", function( assert ) {
12 assert.expect( 1 );
13
14 var config = {
15 activeClass: "active",
16 drop: function() {
17 var element = $( this ),
18 newDroppable = $( "<div>" )
19 .css( { width: 100, height: 100 } )
20 .text( "Droppable" );
21 element.after( newDroppable );
22 element.remove();
23 newDroppable.droppable( config );
24 }
25 },
26
27 draggable = $( "#draggable1" ).draggable(),
28 droppable1 = $( "#droppable1" ).droppable( config ),
29 droppable2 = $( "#droppable2" ).droppable( config ),
30
31 droppableOffset = droppable1.offset(),
32 draggableOffset = draggable.offset(),
33 dx = droppableOffset.left - draggableOffset.left,
34 dy = droppableOffset.top - draggableOffset.top;
35
36 draggable.simulate( "drag", {
37 dx: dx,
38 dy: dy
39 } );
40
41 assert.lacksClasses( droppable2, "active", "subsequent droppable no longer active" );
42 } );
43
44 // Todo: comment the following in when ready to actually test
45 /*
46 Test("activate", function() {
47 ok(false, 'missing test - untested code is broken code');
48 });
49
50 test("deactivate", function() {
51 ok(false, 'missing test - untested code is broken code');
52 });
53
54 test("over", function() {
55 ok(false, 'missing test - untested code is broken code');
56 });
57
58 test("out", function() {
59 ok(false, 'missing test - untested code is broken code');
60 });
61
62 test("drop", function() {
63 ok(false, 'missing test - untested code is broken code');
64 });
65 */
66
67 } );