]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Use new has/lacksClasses assertions for all class checks
authorAlexander Schmitz <arschmitz@gmail.com>
Fri, 30 Jan 2015 14:56:42 +0000 (09:56 -0500)
committerAlexander Schmitz <arschmitz@gmail.com>
Wed, 11 Mar 2015 20:05:39 +0000 (16:05 -0400)
tests/unit/autocomplete/autocomplete_methods.js
tests/unit/autocomplete/autocomplete_options.js

index 1bfa1055428a57abeb953d49c3229ffcc76fc3c6..bbd016ff29b8412957d7c9614bea7701f16b5891 100644 (file)
@@ -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 ) );
index 4b4957222b499699075742f916b5ae8aa2c34878..af9a424e9a386986fb5b9bff77051147648dff6b 100644 (file)
@@ -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" ) );