Tooltip: Use new has/lacksClasses assertions for all class checks

This commit is contained in:
Alexander Schmitz 2015-01-30 11:01:32 -05:00
parent b88a821070
commit 7b01dc3d2c
2 changed files with 5 additions and 5 deletions

View File

@ -2,12 +2,12 @@
module( "tooltip: (deprecated) options" ); module( "tooltip: (deprecated) options" );
test( "tooltipClass", function() { test( "tooltipClass", function( assert ) {
expect( 1 ); expect( 1 );
var element = $( "#tooltipped1" ).tooltip({ var element = $( "#tooltipped1" ).tooltip({
tooltipClass: "custom" tooltipClass: "custom"
}).tooltip( "open" ); }).tooltip( "open" );
ok( $( "#" + element.data( "ui-tooltip-id" ) ).hasClass( "custom" ) ); assert.hasClasses( $( "#" + element.data( "ui-tooltip-id" ) ), "custom" );
}); });
}( jQuery ) ); }( jQuery ) );

View File

@ -53,7 +53,7 @@ test( "open/close with tracking", function() {
$.fx.off = false; $.fx.off = false;
}); });
test( "enable/disable", function() { test( "enable/disable", function( assert ) {
expect( 11 ); expect( 11 );
$.fx.off = true; $.fx.off = true;
var tooltip, var tooltip,
@ -67,9 +67,9 @@ test( "enable/disable", function() {
element.tooltip( "disable" ); element.tooltip( "disable" );
equal( $( ".ui-tooltip" ).length, 0, "no tooltip when disabled" ); equal( $( ".ui-tooltip" ).length, 0, "no tooltip when disabled" );
ok( !element.tooltip( "widget" ).hasClass( "ui-state-disabled" ), "element doesn't get ui-state-disabled" ); assert.lacksClasses( element.tooltip( "widget" ), "ui-state-disabled" );
ok( !element.tooltip( "widget" ).attr( "aria-disabled" ), "element doesn't get aria-disabled" ); ok( !element.tooltip( "widget" ).attr( "aria-disabled" ), "element doesn't get aria-disabled" );
ok( !element.tooltip( "widget" ).hasClass( "ui-tooltip-disabled" ), "element doesn't get ui-tooltip-disabled" ); assert.lacksClasses( element.tooltip( "widget" ), "ui-tooltip-disabled" );
strictEqual( tooltip.attr( "title" ), undefined, "title removed on disable" ); strictEqual( tooltip.attr( "title" ), undefined, "title removed on disable" );
element.tooltip( "open" ); element.tooltip( "open" );