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

35 lines
871 B
JavaScript
Raw Normal View History

define( [
2016-04-03 16:32:14 +00:00
"qunit",
"jquery",
"lib/helper",
2015-04-07 14:55:52 +00:00
"./helper",
"ui/widgets/droppable"
], function( QUnit, $, helper, testHelper ) {
"use strict";
QUnit.module( "droppable: core", { afterEach: helper.moduleAfterEach } );
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" );
if ( 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
} );
} );
} );