Tests: do not create data cache when fetching single property

(test cherry-picked from f5bf9bc488)
Refs gh-2554
This commit is contained in:
Jason Bedard 2015-08-23 14:23:35 -07:00 committed by Michał Gołębiowski
parent bec2ba2312
commit 0874096797

View File

@ -1121,3 +1121,19 @@ testIframeWithCallback(
);
}
);
QUnit.test( ".data(prop) does not create expando", function( assert ) {
assert.expect( 1 );
var key,
div = jQuery( "<div/>" );
div.data("foo");
assert.equal( false, jQuery.hasData( div[0] ) );
// Make sure no expando has been added
for ( key in div[ 0 ] ) {
if ( /^jQuery/.test( key ) ) {
assert.ok( false, "Expando was created on access" );
}
}
} );