jquery-ui/tests/unit/droppable/core.js

30 lines
733 B
JavaScript
Raw Normal View History

define( [
"jquery",
2015-04-07 14:55:52 +00:00
"./helper",
"ui/widgets/droppable"
], function( $, testHelper ) {
2015-08-24 12:59:32 +00:00
module( "droppable: core" );
2015-08-24 12:59:32 +00:00
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,hr" +
2015-08-24 12:59:32 +00:00
",input,button,label,select,iframe" ).split( "," );
expect( typeNames.length );
2015-08-24 12:59:32 +00:00
$.each( typeNames, function( i ) {
var typeName = typeNames[ i ],
el = $( document.createElement( typeName ) ).appendTo( "body" );
2015-08-24 12:59:32 +00:00
( typeName === "table" && el.append( "<tr><td>content</td></tr>" ) );
el.droppable();
testHelper.shouldDrop();
2015-08-24 12:59:32 +00:00
el.droppable( "destroy" );
el.remove();
2015-08-24 12:59:32 +00:00
} );
} );
} );