From: Oleg Gaidarenko Date: Sat, 12 Mar 2016 13:40:41 +0000 (+0300) Subject: Tests: add additional test for jQuery.isPlainObject X-Git-Tag: 3.0.0-rc1~60 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F2993%2Fhead;p=jquery.git Tests: add additional test for jQuery.isPlainObject Ref 00575d4d8c7421c5119f181009374ff2e7736127 Also see discussion in https://github.com/jquery/jquery/pull/2970#discussion_r54970557 --- diff --git a/test/unit/core.js b/test/unit/core.js index d71539c02..2f4831828 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -365,7 +365,6 @@ QUnit.asyncTest( "isPlainObject", function( assert ) { } } ); -// QUnit[ typeof Symbol === "function" ? "test" : "skip" ]( "isPlainObject(Symbol)", function( assert ) { assert.expect( 2 ); @@ -373,6 +372,17 @@ QUnit[ typeof Symbol === "function" ? "test" : "skip" ]( "isPlainObject(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 );