🌐 AI搜索 & 代理 主页
Skip to content

Commit 728ea2f

Browse files
committed
Tests: add additional test for jQuery.isPlainObject
Ref 00575d4 Also see discussion in #2970 (comment)
1 parent 59ec78e commit 728ea2f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/unit/core.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,24 @@ QUnit.asyncTest( "isPlainObject", function( assert ) {
365365
}
366366
} );
367367

368-
//
369368
QUnit[ typeof Symbol === "function" ? "test" : "skip" ]( "isPlainObject(Symbol)", function( assert ) {
370369
assert.expect( 2 );
371370

372371
assert.equal( jQuery.isPlainObject( Symbol() ), false, "Symbol" );
373372
assert.equal( jQuery.isPlainObject( Object( Symbol() ) ), false, "Symbol inside an object" );
374373
} );
375374

375+
QUnit[ "assign" in Object ? "test" : "skip" ]( "isPlainObject(Object.assign(...))",
376+
function( assert ) {
377+
assert.expect( 1 );
378+
379+
var parentObj = { foo: "bar" };
380+
var childObj = Object.assign( Object.create( parentObj ), { bar: "foo" } );
381+
382+
assert.ok( !jQuery.isPlainObject( childObj ), "isPlainObject(Object.assign(...))" );
383+
}
384+
);
385+
376386

377387
QUnit.test( "isFunction", function( assert ) {
378388
assert.expect( 19 );

0 commit comments

Comments
 (0)