]> source.dussan.org Git - jquery-ui.git/commitdiff
Tests: Use closeEnough() to account for rounding differences
authorTJ VanToll <tj.vantoll@gmail.com>
Mon, 23 Jun 2014 01:00:03 +0000 (21:00 -0400)
committerTJ VanToll <tj.vantoll@gmail.com>
Wed, 25 Jun 2014 16:16:29 +0000 (12:16 -0400)
Selectmenu's test suite broke with b0e8380, which changed the padding
used by the menu widget. Selectmenu conditionally adds pixels to the
menu's width, and using closeEnough() accounts for that and the
rounding differences across browsers.

Closes gh-1275

tests/unit/selectmenu/selectmenu_options.js

index 32c875403c6f44107d8bc8c75b15fc2547072d69..25448fd403d315a066f9bc07f9cf4340fc5d950b 100644 (file)
@@ -98,7 +98,7 @@ test( "Width", function() {
 
        equal( button.outerWidth(), element.outerWidth(), "button width auto" );
        element.selectmenu( "open" );
-       equal( menu.outerWidth(), element.outerWidth(), "menu width auto" );
+       closeEnough( menu.outerWidth(), element.outerWidth(), 2, "menu width auto" );
 
        element.outerWidth( 100 );
        element.selectmenu( "refresh" );