diff options
author | rwldrn <waldron.rick@gmail.com> | 2011-06-06 20:18:36 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-06-06 20:18:36 -0400 |
commit | 07420566452622f37b01e69bbbdcbeeb5317e065 (patch) | |
tree | 1241a1581826dba50e32a3511e11b901177557f2 /test | |
parent | c3c001cf5b0970457cc9d7492cb66bdc9a901a1e (diff) | |
download | jquery-07420566452622f37b01e69bbbdcbeeb5317e065.tar.gz jquery-07420566452622f37b01e69bbbdcbeeb5317e065.zip |
Landing pull request 403. Check for both camelized and hyphenated data property names; Fixes #9301.
More Details:
- https://github.com/jquery/jquery/pull/403
- http://bugs.jquery.com/ticket/9301
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/data.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/data.js b/test/unit/data.js index 1af2077ec..87a3de339 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -508,3 +508,20 @@ test("jQuery.data should follow html5 specification regarding camel casing", fun div.remove(); }); + +test("jQuery.data should not miss data with preset hyphenated property names", function() { + + expect(2); + + var div = jQuery("<div/>", { id: "hyphened" }).appendTo("#qunit-fixture"), + test = { + "camelBar": "camelBar", + "hyphen-foo": "hyphen-foo" + }; + + div.data( test ); + + jQuery.each( test , function(i, k) { + equal( div.data(k), k, "data with property '"+k+"' was correctly found"); + }); +}); |