aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2015-01-30 09:56:42 -0500
committerAlexander Schmitz <arschmitz@gmail.com>2015-03-11 16:05:39 -0400
commit0f370b3e35247cac544e1702f0d436853ab89193 (patch)
tree661a74960f8f5566ccaf70bbbc66421ba7aff4dc
parent66001a2f2880bb3c62d941f60ee9ddb90aef1965 (diff)
downloadjquery-ui-0f370b3e35247cac544e1702f0d436853ab89193.tar.gz
jquery-ui-0f370b3e35247cac544e1702f0d436853ab89193.zip
Autocomplete: Use new has/lacksClasses assertions for all class checks
-rw-r--r--tests/unit/autocomplete/autocomplete_methods.js4
-rw-r--r--tests/unit/autocomplete/autocomplete_options.js6
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/unit/autocomplete/autocomplete_methods.js b/tests/unit/autocomplete/autocomplete_methods.js
index 1bfa10554..bbd016ff2 100644
--- a/tests/unit/autocomplete/autocomplete_methods.js
+++ b/tests/unit/autocomplete/autocomplete_methods.js
@@ -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 ) );
diff --git a/tests/unit/autocomplete/autocomplete_options.js b/tests/unit/autocomplete/autocomplete_options.js
index 4b4957222..af9a424e9 100644
--- a/tests/unit/autocomplete/autocomplete_options.js
+++ b/tests/unit/autocomplete/autocomplete_options.js
@@ -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" ) );