Skip to content
Permalink
Browse files

droppable unit tests: created separate file for each module: core, co…

…mmon widget, events, methods, options, tickets
  • Loading branch information
rdworth committed Feb 2, 2009
1 parent 39b0bbc commit bff0f70e2c97f11e58e24c6b88e57ea978e938a9
@@ -13,7 +13,12 @@
<script type="text/javascript" src="../../../external/qunit/testrunner.js"></script>
<script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script>

<script type="text/javascript" src="droppable.js"></script>
<script type="text/javascript" src="droppable_core.js"></script>
<script type="text/javascript" src="droppable_defaults.js"></script>
<script type="text/javascript" src="droppable_events.js"></script>
<script type="text/javascript" src="droppable_methods.js"></script>
<script type="text/javascript" src="droppable_options.js"></script>
<script type="text/javascript" src="droppable_tickets.js"></script>
</head>
<body>

This file was deleted.

@@ -0,0 +1,36 @@
/*
* droppable_core.js
*/

var el, drg;

function shouldBeDroppable() {
ok(false, 'missing test - untested code is broken code');
}

function shouldNotBeDroppable() {
ok(false, 'missing test - untested code is broken code');
}

(function($) {

module("droppable: core");

test("element types", function() {
var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form'
+ ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr'
+ ',acronym,code,samp,kbd,var,img,object,hr'
+ ',input,button,label,select,iframe').split(',');

$.each(typeNames, function(i) {
var typeName = typeNames[i];
el = $(document.createElement(typeName)).appendTo('body');
(typeName == 'table' && el.append("<tr><td>content</td></tr>"));
el.droppable();
shouldBeDroppable();
el.droppable("destroy");
el.remove();
});
});

})(jQuery);
@@ -0,0 +1,16 @@
/*
* droppable_defaults.js
*/

var droppable_defaults = {
accept: '*',
activeClass: false,
cssNamespace: "ui",
disabled: false,
greedy: false,
hoverClass: false,
scope: "default",
tolerance: "intersect"
};

commonWidgetTests('droppable', { defaults: droppable_defaults });
@@ -0,0 +1,28 @@
/*
* droppable_events.js
*/
(function($) {

module("droppable: events");

test("activate", function() {
ok(false, 'missing test - untested code is broken code');
});

test("deactivate", function() {
ok(false, 'missing test - untested code is broken code');
});

test("over", function() {
ok(false, 'missing test - untested code is broken code');
});

test("out", function() {
ok(false, 'missing test - untested code is broken code');
});

test("drop", function() {
ok(false, 'missing test - untested code is broken code');
});

})(jQuery);

0 comments on commit bff0f70

Please sign in to comment.
You can’t perform that action at this time.