Skip to content

Commit

Permalink
Update unit tests for Issue jquery#3005
Browse files Browse the repository at this point in the history
  • Loading branch information
jtrumbull committed Mar 17, 2016
1 parent 773e138 commit 9cdef40
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/unit/serialize.js
Expand Up @@ -73,13 +73,16 @@ QUnit.test( "jQuery.param()", function( assert ) {

params = { "param1": null };
assert.equal( jQuery.param( params, false ), "param1=", "Make sure that null params aren't traversed." );


params = { "param1": function() {}, "param2": function() { return null; } };
assert.equal( jQuery.param( params, false ), "param1=&param2=", "object with method properties return null" );

params = { "test": { "length": 3, "foo": "bar" } };
assert.equal( jQuery.param( params, false ), "test%5Blength%5D=3&test%5Bfoo%5D=bar", "Sub-object with a length property" );

params = { "test": [ 1, 2, null ] };
assert.equal( jQuery.param( params, false ), "test%5B%5D=1&test%5B%5D=2&test%5B%5D=", "object with array property with null value" );

if ( jQuery.ajaxSettings === settings ) {
delete jQuery.ajaxSettings;
} else {
Expand Down

0 comments on commit 9cdef40

Please sign in to comment.