Selectmenu: Don't check menu width in width option tests

This commit is contained in:
Scott González 2014-07-29 15:02:36 -04:00
parent 749a6a5667
commit 64faf2da0a

View File

@ -87,43 +87,31 @@ test( "CSS styles", function() {
test( "width", function() { test( "width", function() {
expect( 9 ); expect( 5 );
var button, menu, var button, menu,
element = $( "#speed" ); element = $( "#speed" );
element.selectmenu(); element.selectmenu();
button = element.selectmenu( "widget" ); button = element.selectmenu( "widget" );
menu = element.selectmenu( "menuWidget" );
equal( button.outerWidth(), element.outerWidth(), "button width auto" ); equal( button.outerWidth(), element.outerWidth(), "button width auto" );
element.selectmenu( "open" );
closeEnough( menu.outerWidth(), element.outerWidth(), 2, "menu width auto" );
element.outerWidth( 100 ); element.outerWidth( 100 );
element.selectmenu( "refresh" ); element.selectmenu( "refresh" );
equal( button.outerWidth(), 100, "button width set by CSS" ); equal( button.outerWidth(), 100, "button width set by CSS" );
element.selectmenu( "open" );
equal( menu.outerWidth(), 100, "menu width set by CSS" );
element element
.width( "" ) .width( "" )
.selectmenu( "option", "width", 100 ) .selectmenu( "option", "width", 100 )
.selectmenu( "refresh" ); .selectmenu( "refresh" );
equal( button.outerWidth(), 100, "button width set by JS option" ); equal( button.outerWidth(), 100, "button width set by JS option" );
element.selectmenu( "open" );
equal( menu.outerWidth(), 100, "menu width set by JS option" );
element element
.append( $( "<option>", { text: "Option with a little longer text" } ) ) .append( $( "<option>", { text: "Option with a little longer text" } ) )
.selectmenu( "option", "width", "" ) .selectmenu( "option", "width", "" )
.selectmenu( "refresh" ); .selectmenu( "refresh" );
equal( button.outerWidth(), element.outerWidth(), "button width with long option" ); equal( button.outerWidth(), element.outerWidth(), "button width with long option" );
element.selectmenu( "open" );
ok( menu.outerWidth() >= element.outerWidth(), "menu width with long option" );
element.parent().outerWidth( 300 ); element.parent().outerWidth( 300 );
element element