mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Autocomplete: Use new has/lacksClasses assertions for all class checks
This commit is contained in:
parent
66001a2f28
commit
0f370b3e35
@ -34,12 +34,12 @@ test( "search, close", function() {
|
||||
ok( menu.is( ":hidden" ), "menu is hidden after close" );
|
||||
});
|
||||
|
||||
test( "widget", function() {
|
||||
test( "widget", function( assert ) {
|
||||
expect( 2 );
|
||||
var element = $( "#autocomplete" ).autocomplete(),
|
||||
widgetElement = element.autocomplete( "widget" );
|
||||
equal( widgetElement.length, 1, "one element" );
|
||||
ok( widgetElement.is( ".ui-menu" ), "menu element" );
|
||||
assert.hasClasses( widgetElement, "ui-menu" );
|
||||
});
|
||||
|
||||
}( jQuery ) );
|
||||
|
@ -115,7 +115,7 @@ asyncTest( "delay", function() {
|
||||
}, 50 );
|
||||
});
|
||||
|
||||
asyncTest( "disabled", function() {
|
||||
asyncTest( "disabled", function( assert ) {
|
||||
expect( 5 );
|
||||
var element = $( "#autocomplete" ).autocomplete({
|
||||
source: data,
|
||||
@ -126,9 +126,9 @@ asyncTest( "disabled", function() {
|
||||
|
||||
ok( menu.is( ":hidden" ) );
|
||||
|
||||
ok( !element.is( ".ui-state-disabled" ), "element doesn't get ui-state-disabled" );
|
||||
assert.lacksClasses( element, "ui-state-disabled" );
|
||||
assert.hasClasses( menu, "ui-autocomplete-disabled" );
|
||||
ok( !element.attr( "aria-disabled" ), "element doesn't get aria-disabled" );
|
||||
ok( menu.is( ".ui-autocomplete-disabled" ), "element gets ui-autocomplete-disabled" );
|
||||
|
||||
setTimeout(function() {
|
||||
ok( menu.is( ":hidden" ) );
|
||||
|
Loading…
Reference in New Issue
Block a user