diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-10-17 15:31:02 -0400 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-10-25 11:25:00 -0400 |
commit | 3570cc5a2b2ec59fa1ccb4c78a58f526ca69918e (patch) | |
tree | c13b786f6faad40759bb974af59f0a3112fb8cef /tests/unit/selectmenu | |
parent | 56d6ddc2baf3331e6fb13ccbdda9d7029718ecd6 (diff) | |
download | jquery-ui-3570cc5a2b2ec59fa1ccb4c78a58f526ca69918e.tar.gz jquery-ui-3570cc5a2b2ec59fa1ccb4c78a58f526ca69918e.zip |
Tests: Fix button space assertions on IE8
IE8 still doesn't keep the space in the text (or HTML) representation.
We don't really care, so adding more trims in these tests as well.
Diffstat (limited to 'tests/unit/selectmenu')
-rw-r--r-- | tests/unit/selectmenu/core.js | 14 | ||||
-rw-r--r-- | tests/unit/selectmenu/methods.js | 8 |
2 files changed, 11 insertions, 11 deletions
diff --git a/tests/unit/selectmenu/core.js b/tests/unit/selectmenu/core.js index a6024fb9a..689668e70 100644 --- a/tests/unit/selectmenu/core.js +++ b/tests/unit/selectmenu/core.js @@ -89,8 +89,8 @@ test( "_renderButtonItem()", function() { element.selectmenu( "refresh" ); option = element.find( "option:selected" ); equal( - " " + option.text() + element[ 0 ].selectedIndex, - button.text(), + $.trim( button.text() ), + option.text() + element[ 0 ].selectedIndex, "refresh: button item text" ); @@ -98,8 +98,8 @@ test( "_renderButtonItem()", function() { menu.find( "li" ).last().simulate( "mouseover" ).trigger( "click" ); option = element.find( "option" ).last(); equal( - " " + option.text() + element[ 0 ].selectedIndex, - button.text(), + $.trim( button.text() ), + option.text() + element[ 0 ].selectedIndex, "click: button item text" ); } ); @@ -146,7 +146,7 @@ $.each( [ selected.val(), "original select state" ); - equal( button.text(), " " + selected.text(), "button text" ); + equal( $.trim( button.text() ), selected.text(), "button text" ); start(); } ); } ); @@ -181,7 +181,7 @@ $.each( [ selected.val(), "original select state" ); - equal( button.text(), " " + selected.text(), "button text" ); + equal( $.trim( button.text() ), selected.text(), "button text" ); start(); }, 1 ); } ); @@ -222,7 +222,7 @@ $.each( [ "button aria-activedescendant" ); equal( element.find( "option:selected" ).val(), options.eq( 1 ).val(), "original select state" ); - equal( button.text(), " " + options.eq( 1 ).text(), "button text" ); + equal( $.trim( button.text() ), options.eq( 1 ).text(), "button text" ); start(); } ); } ); diff --git a/tests/unit/selectmenu/methods.js b/tests/unit/selectmenu/methods.js index 7007abe83..e8f2d2d37 100644 --- a/tests/unit/selectmenu/methods.js +++ b/tests/unit/selectmenu/methods.js @@ -81,21 +81,21 @@ asyncTest( "refresh - change selected option", function() { var element = $( "#speed" ).selectmenu(), button = element.selectmenu( "widget" ); - equal( button.text(), " Medium", "button text after init" ); + equal( $.trim( button.text() ), "Medium", "button text after init" ); button.simulate( "focus" ); setTimeout( function() { - equal( button.text(), " Medium", "button text after focus" ); + equal( $.trim( button.text() ), "Medium", "button text after focus" ); element[ 0 ].selectedIndex = 0; element.selectmenu( "refresh" ); - equal( button.text(), " Slower", "button text after changing selected option" ); + equal( $.trim( button.text() ), "Slower", "button text after changing selected option" ); element.find( "option" ).prop( "selected", false ); element.append( "<option selected value=\"selected_option\">Selected option</option>" ); element.selectmenu( "refresh" ); - equal( button.text(), " Selected option", "button text after adding selected option" ); + equal( $.trim( button.text() ), "Selected option", "button text after adding selected option" ); start(); } ); |