aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/attributes.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/attributes.js')
-rw-r--r--test/unit/attributes.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js
index 32fd7b958..2ab583caa 100644
--- a/test/unit/attributes.js
+++ b/test/unit/attributes.js
@@ -1462,3 +1462,16 @@ test( "should not throw at $(option).val() (#14686)", 1, function() {
ok( false );
}
});
+
+test( "Insignificant white space returned for $(option).val() (#14858)", function() {
+ expect ( 3 );
+
+ var val = jQuery( "<option></option>" ).val();
+ equal( val.length, 0, "Empty option should have no value" );
+
+ val = jQuery( "<option> </option>" ).val();
+ equal( val.length, 0, "insignificant white-space returned for value" );
+
+ val = jQuery( "<option> test </option>" ).val();
+ equal( val.length, 4, "insignificant white-space returned for value" );
+});