aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/data.js
diff options
context:
space:
mode:
authorrwldrn <waldron.rick@gmail.com>2011-09-07 10:13:22 -0400
committerDave Methvin <dave.methvin@gmail.com>2011-09-07 10:13:22 -0400
commit8e8fa6dc1ad514b0fa20e41faddcb85693d0408a (patch)
tree16e5c5577939b0fd30123b539182ff3f7594ce9f /test/unit/data.js
parent4bc691a1c3a67aefb867e868d5577155571fb659 (diff)
downloadjquery-8e8fa6dc1ad514b0fa20e41faddcb85693d0408a.tar.gz
jquery-8e8fa6dc1ad514b0fa20e41faddcb85693d0408a.zip
Bug in rmultidash. Fixes #10194
Diffstat (limited to 'test/unit/data.js')
-rw-r--r--test/unit/data.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/test/unit/data.js b/test/unit/data.js
index 06c6c2d57..b1bf232a4 100644
--- a/test/unit/data.js
+++ b/test/unit/data.js
@@ -488,23 +488,26 @@ if (window.JSON && window.JSON.stringify) {
}
test("jQuery.data should follow html5 specification regarding camel casing", function() {
- expect(8);
+ expect(10);
- var div = jQuery("<div id='myObject' data-foo='a' data-foo-bar='b' data-foo-bar-baz='c'></div>")
+ var div = jQuery("<div id='myObject' data-w-t-f='ftw' data-big-a-little-a='bouncing-b' data-foo='a' data-foo-bar='b' data-foo-bar-baz='c'></div>")
.prependTo("body");
- equals(div.data().foo, "a", "Verify single word data-* key");
- equals(div.data().fooBar, "b", "Verify multiple word data-* key");
- equals(div.data().fooBarBaz, "c", "Verify multiple word data-* key");
+ equal( div.data().wTF, "ftw", "Verify single letter data-* key" );
+ equal( div.data().bigALittleA, "bouncing-b", "Verify single letter mixed data-* key" );
- equals(div.data("foo"), "a", "Verify single word data-* key");
- equals(div.data("fooBar"), "b", "Verify multiple word data-* key");
- equals(div.data("fooBarBaz"), "c", "Verify multiple word data-* key");
+ equal( div.data().foo, "a", "Verify single word data-* key" );
+ equal( div.data().fooBar, "b", "Verify multiple word data-* key" );
+ equal( div.data().fooBarBaz, "c", "Verify multiple word data-* key" );
+
+ equal( div.data("foo"), "a", "Verify single word data-* key" );
+ equal( div.data("fooBar"), "b", "Verify multiple word data-* key" );
+ equal( 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");
+ equal( div.data("fooBar"), "d", "Verify updated data-* key" );
+ equal( div.data("foo-bar"), "d", "Verify updated data-* key" );
div.remove();
});