aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/data.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-09-22 11:52:32 -0400
committerjeresig <jeresig@gmail.com>2010-09-22 11:52:32 -0400
commit0b4b3ee8a5eda75d8399b333cda54f6b319fe74c (patch)
tree585dca3178834ae70d9e51597d20ae7019990142 /test/unit/data.js
parent626624a19a6cbd70b44da08ee2123ba79f8e2bb0 (diff)
downloadjquery-0b4b3ee8a5eda75d8399b333cda54f6b319fe74c.tar.gz
jquery-0b4b3ee8a5eda75d8399b333cda54f6b319fe74c.zip
Make .data(Object) extend the existing data object. Fixes #6692.
Diffstat (limited to 'test/unit/data.js')
-rw-r--r--test/unit/data.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unit/data.js b/test/unit/data.js
index 54a89d920..1163ddc29 100644
--- a/test/unit/data.js
+++ b/test/unit/data.js
@@ -25,7 +25,7 @@ test("expando", function(){
});
test("jQuery.data", function() {
- expect(12);
+ expect(13);
var div = document.createElement("div");
ok( jQuery.data(div, "test") === undefined, "Check for no data exists" );
@@ -47,9 +47,11 @@ test("jQuery.data", function() {
jQuery.data(div, "test", null);
ok( jQuery.data(div, "test") === null, "Check for null data");
+ jQuery.data(div, "test3", "orig");
jQuery.data(div, { "test": "in", "test2": "in2" });
equals( jQuery.data(div, "test"), "in", "Verify setting an object in data." );
equals( jQuery.data(div, "test2"), "in2", "Verify setting an object in data." );
+ equals( jQuery.data(div, "test3"), "orig", "Verify original not overwritten." );
var obj = {};
jQuery.data( obj, "prop", true );
@@ -61,7 +63,7 @@ test("jQuery.data", function() {
});
test(".data()", function() {
- expect(1);
+ expect(2);
var div = jQuery("#foo");
div.data("test", "success");