diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2011-08-05 09:43:15 -0400 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2011-08-05 09:43:15 -0400 |
commit | 7daf44b5ab1b5fbae9f8cbef9850519433609a12 (patch) | |
tree | 627ab5b7c08a0615141db136c50f2d56e5984706 /test/unit | |
parent | e18cad6f88c7b3151722d5b58616badbea75ddf6 (diff) | |
download | jquery-7daf44b5ab1b5fbae9f8cbef9850519433609a12.tar.gz jquery-7daf44b5ab1b5fbae9f8cbef9850519433609a12.zip |
Adds failing tests for #9413
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/data.js | 28 |
1 files changed, 28 insertions, 0 deletions
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("<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 ); + + }); +});
\ No newline at end of file |