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

31 lines
785 B
JavaScript
Raw Permalink Normal View History

define( [
2016-04-03 16:32:14 +00:00
"qunit",
"jquery",
2015-04-07 14:55:52 +00:00
"./helper",
"ui/widgets/droppable"
2016-04-03 16:32:14 +00:00
], function( QUnit, $, testHelper ) {
2016-04-03 16:32:14 +00:00
QUnit.module( "droppable: core" );
2016-04-03 16:32:14 +00:00
QUnit.test( "element types", function( assert ) {
2015-08-24 12:59:32 +00:00
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( "," );
2016-04-03 16:32:14 +00:00
assert.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();
2016-04-03 16:32:14 +00:00
testHelper.shouldDrop( assert );
2015-08-24 12:59:32 +00:00
el.droppable( "destroy" );
el.remove();
2015-08-24 12:59:32 +00:00
} );
} );
} );