| 1 | define( [ |
| 2 | "qunit", |
| 3 | "jquery", |
| 4 | "lib/helper", |
| 5 | "./helper", |
| 6 | "ui/widgets/droppable" |
| 7 | ], function( QUnit, $, helper, testHelper ) { |
| 8 | "use strict"; |
| 9 | |
| 10 | QUnit.module( "droppable: core", { afterEach: helper.moduleAfterEach } ); |
| 11 | |
| 12 | QUnit.test( "element types", function( assert ) { |
| 13 | var typeNames = ( "p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form" + |
| 14 | ",table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr" + |
| 15 | ",acronym,code,samp,kbd,var,img,hr" + |
| 16 | ",input,button,label,select,iframe" ).split( "," ); |
| 17 | |
| 18 | assert.expect( typeNames.length ); |
| 19 | |
| 20 | $.each( typeNames, function( i ) { |
| 21 | var typeName = typeNames[ i ], |
| 22 | el = $( document.createElement( typeName ) ).appendTo( "body" ); |
| 23 | |
| 24 | if ( typeName === "table" ) { |
| 25 | el.append( "<tr><td>content</td></tr>" ); |
| 26 | } |
| 27 | el.droppable(); |
| 28 | testHelper.shouldDrop( assert ); |
| 29 | el.droppable( "destroy" ); |
| 30 | el.remove(); |
| 31 | } ); |
| 32 | } ); |
| 33 | |
| 34 | } ); |