Permalink
Browse files

Tests: add additional test for jQuery.isPlainObject

Ref 00575d4
Also see discussion in
#2970 (comment)
  • Loading branch information...
1 parent 59ec78e commit 728ea2f27720a351a014b698fd66d25075c0c5e3 @markelog markelog committed Mar 12, 2016
Showing with 11 additions and 1 deletion.
  1. +11 −1 test/unit/core.js
View
@@ -365,14 +365,24 @@ QUnit.asyncTest( "isPlainObject", function( assert ) {
}
} );
-//
QUnit[ typeof Symbol === "function" ? "test" : "skip" ]( "isPlainObject(Symbol)", function( assert ) {
assert.expect( 2 );
assert.equal( jQuery.isPlainObject( Symbol() ), false, "Symbol" );
assert.equal( jQuery.isPlainObject( Object( Symbol() ) ), false, "Symbol inside an object" );
} );
+QUnit[ "assign" in Object ? "test" : "skip" ]( "isPlainObject(Object.assign(...))",
+ function( assert ) {
+ assert.expect( 1 );
+
+ var parentObj = { foo: "bar" };
+ var childObj = Object.assign( Object.create( parentObj ), { bar: "foo" } );
+
+ assert.ok( !jQuery.isPlainObject( childObj ), "isPlainObject(Object.assign(...))" );
+ }
+);
+
QUnit.test( "isFunction", function( assert ) {
assert.expect( 19 );

0 comments on commit 728ea2f

Please sign in to comment.