<script src="../../../external/qunit/qunit.js"></script>
<script src="../../../external/jquery-simulate/jquery.simulate.js"></script>
<script src="../testsuite.js"></script>
+ <script src="../../../external/qunit-assert-classes/qunit-assert-classes.js"></script>
<script>
TestHelpers.loadResources({
css: [ "core" ],
module( "droppable: events" );
-test( "droppable destruction/recreation on drop event", function() {
+test( "droppable destruction/recreation on drop event", function( assert ) {
expect( 1 );
var config = {
dy: dy
});
- ok( !droppable2.hasClass( "active" ), "subsequent droppable no longer active" );
+ assert.lacksClasses( droppable2, "active", "subsequent droppable no longer active" );
});
// todo: comment the following in when ready to actually test
equal(actual, expected, "enable is chainable");
});
-test( "disable", function() {
+test( "disable", function( assert ) {
expect( 10 );
var actual, expected,
element.droppable({ disabled: false });
TestHelpers.droppable.shouldDrop();
element.droppable( "option", "disabled", true );
- ok( !element.droppable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" );
+ assert.lacksClasses( element.droppable( "widget" ), "ui-state-disabled" );
ok( !element.droppable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
- ok( element.droppable( "widget" ).hasClass( "ui-droppable-disabled" ), "element gets ui-droppable-disabled" );
+ assert.hasClasses( element.droppable( "widget" ), "ui-droppable-disabled" );
equal( element.droppable( "option", "disabled" ), true, "disabled option setter" );
TestHelpers.droppable.shouldNotDrop();
ok(false, 'missing test - untested code is broken code');
});
*/
-test( "{ addClasses: true }, default", function() {
+test( "{ addClasses: true }, default", function( assert ) {
expect( 1 );
var el = $( "<div />" ).droppable({ addClasses: true });
- ok( el.is( ".ui-droppable" ), "'ui-droppable' class added" );
+ assert.hasClasses( el, "ui-droppable" );
el.droppable( "destroy" );
});
-test( "{ addClasses: false }", function() {
+test( "{ addClasses: false }", function( assert ) {
expect( 1 );
var el = $( "<div />" ).droppable({ addClasses: false });
- ok( !el.is( ".ui-droppable" ), "'ui-droppable' class not added" );
+
+ assert.lacksClasses( el, "ui-droppable" );
el.droppable( "destroy" );
});