diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2015-05-03 08:22:32 -0400 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2015-05-03 08:25:19 -0400 |
commit | 2862a07af640be42711f72ad4abe532349985824 (patch) | |
tree | 74370f567449623c0b7f8736a4c5d61ef9e2171c /test | |
parent | a873558436383beea7a05fd07db7070a30420100 (diff) | |
download | jquery-2862a07af640be42711f72ad4abe532349985824.tar.gz jquery-2862a07af640be42711f72ad4abe532349985824.zip |
Data: do not include digits when camelCasing
Fixes gh-1751
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/core.js | 2 | ||||
-rw-r--r-- | test/unit/data.js | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/test/unit/core.js b/test/unit/core.js index b9fef3cf2..b355611d4 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -1503,7 +1503,7 @@ test("jQuery.camelCase()", function() { "foo-bar": "fooBar", "foo-bar-baz": "fooBarBaz", "girl-u-want": "girlUWant", - "the-4th-dimension": "the4thDimension", + "the-4th-dimension": "the-4thDimension", "-o-tannenbaum": "OTannenbaum", "-moz-illa": "MozIlla", "-ms-take": "msTake" diff --git a/test/unit/data.js b/test/unit/data.js index 7330f02cd..89a81b48b 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -259,14 +259,14 @@ test(".data(object) does not retain references. #13815", function() { }); test("data-* attributes", function() { - expect( 43 ); + expect( 46 ); var prop, i, l, metadata, elem, obj, obj2, check, num, num2, parseJSON = jQuery.parseJSON, div = jQuery("<div>"), - child = jQuery("<div data-myobj='old data' data-ignored=\"DOM\" data-other='test'></div>"), - dummy = jQuery("<div data-myobj='old data' data-ignored=\"DOM\" data-other='test'></div>"); + child = jQuery("<div data-myobj='old data' data-ignored=\"DOM\" data-other='test' data-foo-42='boosh'></div>"), + dummy = jQuery("<div data-myobj='old data' data-ignored=\"DOM\" data-other='test' data-foo-42='boosh'></div>"); equal( div.data("attr"), undefined, "Check for non-existing data-attr attribute" ); @@ -283,6 +283,7 @@ test("data-* attributes", function() { child.appendTo("#qunit-fixture"); equal( child.data("myobj"), "old data", "Value accessed from data-* attribute"); + equal( child.data("foo-42"), "boosh", "camelCasing does not affect numbers (#1751)" ); child.data("myobj", "replaced"); equal( child.data("myobj"), "replaced", "Original data overwritten"); @@ -292,7 +293,7 @@ test("data-* attributes", function() { obj = child.data(); obj2 = dummy.data(); - check = [ "myobj", "ignored", "other" ]; + check = [ "myobj", "ignored", "other", "foo-42" ]; num = 0; num2 = 0; |