aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Gaidarenko <markelog@gmail.com>2016-03-12 16:40:41 +0300
committerOleg Gaidarenko <markelog@gmail.com>2016-03-12 16:43:02 +0300
commit728ea2f27720a351a014b698fd66d25075c0c5e3 (patch)
tree09b159e448c0e97dd4e95b1708d9567212cade33
parent59ec78e6020cc963c1f95cb96a28eaaf20e37b3e (diff)
downloadjquery-728ea2f27720a351a014b698fd66d25075c0c5e3.tar.gz
jquery-728ea2f27720a351a014b698fd66d25075c0c5e3.zip
Tests: add additional test for jQuery.isPlainObject
Ref 00575d4d8c7421c5119f181009374ff2e7736127 Also see discussion in https://github.com/jquery/jquery/pull/2970#discussion_r54970557
-rw-r--r--test/unit/core.js12
1 files changed, 11 insertions, 1 deletions
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 );