diff options
author | John Resig <jeresig@gmail.com> | 2011-05-10 11:56:42 -0400 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2011-05-10 11:56:42 -0400 |
commit | a5e407cafb9d398b5bf2f209ad0e8a42691bf391 (patch) | |
tree | 84ae0db76ba289044c0e103d23edc75f511bb3e3 /test | |
parent | 419b5e5e2a0d376e71c3f37bf9a3d96f3b4a67f2 (diff) | |
download | jquery-a5e407cafb9d398b5bf2f209ad0e8a42691bf391.tar.gz jquery-a5e407cafb9d398b5bf2f209ad0e8a42691bf391.zip |
Make sure that data properties with hyphens are always accessed/set using camelCase. Fixes #9124.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/data.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/unit/data.js b/test/unit/data.js index 8b5ce9612..1af2077ec 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -488,7 +488,7 @@ if (window.JSON && window.JSON.stringify) { } test("jQuery.data should follow html5 specification regarding camel casing", function() { - expect(6); + expect(8); var div = jQuery("<div id='myObject' data-foo='a' data-foo-bar='b' data-foo-bar-baz='c'></div>") .prependTo("body"); @@ -501,5 +501,10 @@ test("jQuery.data should follow html5 specification regarding camel casing", fun equals(div.data("fooBar"), "b", "Verify multiple word data-* key"); equals(div.data("fooBarBaz"), "c", "Verify multiple word data-* key"); + div.data("foo-bar", "d"); + + equals(div.data("fooBar"), "d", "Verify updated data-* key"); + equals(div.data("foo-bar"), "d", "Verify updated data-* key"); + div.remove(); -});
\ No newline at end of file +}); |