aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/widget/widget_extend.js
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2012-11-10 01:40:05 +0100
committerFelix Nagel <info@felixnagel.com>2012-11-10 01:40:05 +0100
commit7ce8e0515ea7cc513c3c065946c85cf2d1aa5652 (patch)
treea0337f9f7d8d0d27a7cdb78a63ee152d8357b32f /tests/unit/widget/widget_extend.js
parent94b3a65c66e338fc6f697d13fc77d7f19b8666ae (diff)
parentd6c6b7dc3381432f50212b4f458931b2521ecb56 (diff)
downloadjquery-ui-7ce8e0515ea7cc513c3c065946c85cf2d1aa5652.tar.gz
jquery-ui-7ce8e0515ea7cc513c3c065946c85cf2d1aa5652.zip
Merge branch 'master' into selectmenu
Diffstat (limited to 'tests/unit/widget/widget_extend.js')
-rw-r--r--tests/unit/widget/widget_extend.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/unit/widget/widget_extend.js b/tests/unit/widget/widget_extend.js
index ae9855929..14f9a46e0 100644
--- a/tests/unit/widget/widget_extend.js
+++ b/tests/unit/widget/widget_extend.js
@@ -1,5 +1,5 @@
test( "$.widget.extend()", function() {
- expect( 26 );
+ expect( 27 );
var ret, empty, optionsWithLength, optionsWithDate, myKlass, customObject, optionsWithCustomObject, nullUndef,
target, recursive, obj, input, output,
@@ -76,13 +76,16 @@ test( "$.widget.extend()", function() {
ret = $.widget.extend( { foo: [] }, { foo: [0] } ); // 1907
equal( ret.foo.length, 1, "Check to make sure a value with coersion 'false' copies over when necessary to fix #1907" );
- ret = $.widget.extend( { foo: "1,2,3" }, { foo: [1, 2, 3] } );
- strictEqual( typeof ret.foo, "object", "Check to make sure values equal with coersion (but not actually equal) overwrite correctly" );
+ ret = $.widget.extend( { foo: "1,2,3" }, { foo: [ 1, 2, 3 ] } );
+ deepEqual( ret.foo, [ 1, 2, 3 ], "Properly extend a string to array." );
- ret = $.widget.extend( { foo:"bar" }, { foo:null } );
- strictEqual( typeof ret.foo, "object", "Make sure a null value doesn't crash with deep extend, for #1908" );
+ ret = $.widget.extend( { foo: "1,2,3" }, { foo: { to: "object" } } );
+ deepEqual( ret.foo, { to: "object" }, "Properly extend a string to object." );
- obj = { foo:null };
+ ret = $.widget.extend( { foo: "bar" }, { foo: null } );
+ strictEqual( ret.foo, null, "Make sure a null value doesn't crash with deep extend, for #1908" );
+
+ obj = { foo: null };
$.widget.extend( obj, { foo:"notnull" } );
equal( obj.foo, "notnull", "Make sure a null value can be overwritten" );