git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure that undefined is always returned for missing data properties. Follow-up...
[jquery.git]
/
test
/
unit
/
data.js
diff --git
a/test/unit/data.js
b/test/unit/data.js
index
25d5196
..
77ee099
100644
(file)
--- a/
test/unit/data.js
+++ b/
test/unit/data.js
@@
-81,11
+81,14
@@
test("jQuery.data", function() {
});
test(".data()", function() {
});
test(".data()", function() {
- expect(2);
+ expect(4);
var div = jQuery("#foo");
var div = jQuery("#foo");
+ strictEqual( div.data("foo"), undefined, "Make sure that missing result is undefined" );
+
div.data("test", "success");
same( div.data(), {test: "success"}, "data() get the entire data object" );
div.data("test", "success");
same( div.data(), {test: "success"}, "data() get the entire data object" );
+ strictEqual( div.data("foo"), undefined, "Make sure that missing result is still undefined" );
var nodiv = jQuery("#unfound");
equals( nodiv.data(), null, "data() on empty set returns null" );
var nodiv = jQuery("#unfound");
equals( nodiv.data(), null, "data() on empty set returns null" );