}
});
- asyncTest( "empty option - " + settings.type, function() {
+ asyncTest( "empty option - " + settings.type, function( assert ) {
expect( 7 );
var button, menu, wrappers, wrapper,
"correct amount of list elements" );
ok( wrapper.outerHeight() > 10, "empty item seems to have reasonable height" );
ok( wrapper.attr( "id" ), "empty item has id attribute" );
- ok( wrapper.parent().hasClass( "ui-menu-item" ),
- "empty item has ui-menu-item class" );
- ok( !wrapper.hasClass( "ui-menu-divider" ),
- "empty item does not have ui-menu-divider class" );
+ assert.hasClasses( wrapper.parent(), "ui-menu-item" );
+ assert.lacksClasses( wrapper, "ui-menu-divider" );
equal( wrapper.attr( "tabindex" ), -1, "empty item has tabindex" );
equal( wrapper.attr( "role" ), "option", "empty item has role option" );
equal( menu.attr( "aria-disabled" ), "true", "menu ARIA" );
});
-test( "refresh - disabled option", function() {
+test( "refresh - disabled option", function( assert ) {
expect( 1 );
var disabledItem,
element.selectmenu( "refresh" );
disabledItem = menu.find( "li" ).not( ".ui-selectmenu-optgroup" ).eq( 2 );
- ok( disabledItem.hasClass( "ui-state-disabled" ), "class" );
+ assert.hasClasses( disabledItem, "ui-state-disabled" );
});
-test( "refresh - disabled optgroup", function() {
+test( "refresh - disabled optgroup", function( assert ) {
var i, item,
element = $( "#files" ).selectmenu(),
menu = element.selectmenu( "menuWidget" ).parent(),
element.selectmenu( "refresh" );
item = menu.find( "li.ui-selectmenu-optgroup" ).first();
- ok( item.hasClass( "ui-state-disabled" ), "class" );
+
+ assert.hasClasses( item, "ui-state-disabled" );
equal(
menu.find( "li" ).not( ".ui-selectmenu-optgroup" ).filter( ".ui-state-disabled" ).length,
);
for ( i = 0; i < originalDisabledOptions.length; i++ ) {
item = item.next( "li" );
- ok( item.hasClass( "ui-state-disabled" ), "item #" + i + ": class" );
+ assert.hasClasses( item, "ui-state-disabled" );
}
});
equal( menu.children().length, 0, "Empty menu" );
});
-test( "widget and menuWidget", function() {
+test( "widget and menuWidget", function( assert ) {
expect( 4 );
var element = $( "#speed" ).selectmenu(),
menu = element.selectmenu( "menuWidget" );
equal( button.length, 1, "button: one element" );
- ok( button.is( ".ui-selectmenu-button" ), "button: class" );
+ assert.hasClasses( button, "ui-selectmenu-button" );
equal( menu.length, 1, "Menu Widget: one element" );
ok( menu.is( "ul.ui-menu" ), "Menu Widget: element and class" );
$( "#selectmenu-wrap2" )[ 0 ], "empty jQuery object, inside .ui-front" );
});
-test( "CSS styles", function() {
- expect( 2 );
+test( "CSS styles", function( assert ) {
+ expect( 5 );
var element = $( "#speed" ).selectmenu(),
button = element.selectmenu( "widget" ),
menu = element.selectmenu( "menuWidget" );
element.selectmenu( "open" );
- ok(
- button.hasClass( "ui-corner-top" ) && !button.hasClass( "ui-corner-all" ) &&
- button.find( "span.ui-icon" ).hasClass( "ui-icon-triangle-1-s" ),
- "button styles dropdown"
- );
- ok( menu.hasClass( "ui-corner-bottom" ) && !menu.hasClass( "ui-corner-all" ),
- "menu styles dropdown" );
+
+ assert.hasClasses( button, "ui-corner-top" );
+ assert.lacksClasses( button, "ui-corner-all" );
+ assert.hasClasses( button.find( "span.ui-icon" ), "ui-icon-triangle-1-s" );
+ assert.hasClasses( menu, "ui-corner-bottom" );
+ assert.lacksClasses( button, "ui-corner-all" );
});
test( "width", function() {