Tests: add additional test for jQuery.isPlainObject

Ref 00575d4d8c
Also see discussion in
https://github.com/jquery/jquery/pull/2970#discussion_r54970557
This commit is contained in:
Oleg Gaidarenko 2016-03-12 16:40:41 +03:00
parent 59ec78e602
commit 728ea2f277

View File

@ -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 );