File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1120,7 +1120,8 @@ QUnit.test( "select.val(space characters) (gh-2978)", function( assert ) {
11201120 "\\u00a0" : "\u00a0" ,
11211121 "\\u1680" : "\u1680"
11221122 } ,
1123- html = "" ;
1123+ html = "" ,
1124+ runicode = / ^ \\ u / ;
11241125 jQuery . each ( spaces , function ( key , obj ) {
11251126 var value = obj . html || obj ;
11261127 html += "<option value='attr" + value + "'></option>" ;
@@ -1151,9 +1152,15 @@ QUnit.test( "select.val(space characters) (gh-2978)", function( assert ) {
11511152 $select . html ( html ) ;
11521153
11531154 $select . val ( "text" ) ;
1154- assert . equal ( $select . val ( ) , "text" , "Value with space character at beginning or end is stripped (" + key + ") selected (text)" ) ;
11551155
1156- if ( / ^ \\ u / . test ( key ) ) {
1156+ // IE6-8 doesn't trim the option values
1157+ if ( runicode . test ( key ) && / m s i e [ 6 7 8 ] \. 0 / i. test ( window . navigator . userAgent ) ) {
1158+ assert . ok ( true , "IE6-8 doesn't trim the option values" ) ;
1159+ } else {
1160+ assert . equal ( $select . val ( ) , "text" , "Value with space character at beginning or end is stripped (" + key + ") selected (text)" ) ;
1161+ }
1162+
1163+ if ( runicode . test ( key ) ) {
11571164 $select . val ( "te" + val + "xt" ) ;
11581165 assert . equal ( $select . val ( ) , "te" + val + "xt" , "Value with non-space whitespace character (" + key + ") in the middle selected (text)" ) ;
11591166 } else {
You can’t perform that action at this time.
0 commit comments