From: Rick Waldron Date: Fri, 5 Aug 2011 13:43:15 +0000 (-0400) Subject: Adds failing tests for #9413 X-Git-Tag: 1.6.3rc1~22^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7daf44b5ab1b5fbae9f8cbef9850519433609a12;p=jquery.git Adds failing tests for #9413 --- diff --git a/test/unit/data.js b/test/unit/data.js index c62bd1cc1..55201b4e3 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -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("
", { 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 ); + + }); +}); \ No newline at end of file