mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Adds failing tests for #9413
This commit is contained in:
parent
e18cad6f88
commit
7daf44b5ab
@ -551,3 +551,31 @@ test("jQuery.data supports interoperable hyphenated/camelCase get/set of propert
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("jQuery.data supports interoperable removal of hyphenated/camelCase properties", function() {
|
||||||
|
var div = jQuery("<div/>", { id: "hyphened" }).appendTo("#qunit-fixture"),
|
||||||
|
datas = {
|
||||||
|
"non-empty": "a string",
|
||||||
|
"empty-string": "",
|
||||||
|
"one-value": 1,
|
||||||
|
"zero-value": 0,
|
||||||
|
"an-array": [],
|
||||||
|
"an-object": {},
|
||||||
|
"bool-true": true,
|
||||||
|
"bool-false": false,
|
||||||
|
"some-json": '{ "foo": "bar" }'
|
||||||
|
};
|
||||||
|
|
||||||
|
expect( 27 );
|
||||||
|
|
||||||
|
jQuery.each( datas, function( key, val ) {
|
||||||
|
div.data( key, val );
|
||||||
|
|
||||||
|
deepEqual( div.data( key ), val, "get: " + key );
|
||||||
|
deepEqual( div.data( jQuery.camelCase( key ) ), val, "get: " + jQuery.camelCase( key ) );
|
||||||
|
|
||||||
|
div.removeData( key );
|
||||||
|
|
||||||
|
equal( div.data( key ), undefined, "get: " + key );
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user