diff options
author | Scott González <scott.gonzalez@gmail.com> | 2008-05-03 01:39:27 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2008-05-03 01:39:27 +0000 |
commit | ad3c49d1b664d282b1e38b2012a0818f0595d2a5 (patch) | |
tree | 0fe7067f004d5e897064a6181f598a9b56b2535b /test | |
parent | 35c68b4578f804bcd10fe7ee1628cbbd263c32ff (diff) | |
download | jquery-ad3c49d1b664d282b1e38b2012a0818f0595d2a5.tar.gz jquery-ad3c49d1b664d282b1e38b2012a0818f0595d2a5.zip |
core: Fixed #2605: .data() now accepts null as a value.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/core.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/unit/core.js b/test/unit/core.js index 7ec825832..e6321a643 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -1398,13 +1398,17 @@ test("$.className", function() { });
test("$.data", function() {
- expect(3);
+ expect(5);
var div = $("#foo")[0];
ok( jQuery.data(div, "test") == undefined, "Check for no data exists" );
jQuery.data(div, "test", "success");
ok( jQuery.data(div, "test") == "success", "Check for added data" );
jQuery.data(div, "test", "overwritten");
ok( jQuery.data(div, "test") == "overwritten", "Check for overwritten data" );
+ jQuery.data(div, "test", undefined);
+ ok( jQuery.data(div, "test") == "overwritten", "Check that data wasn't removed");
+ jQuery.data(div, "test", null);
+ ok( jQuery.data(div, "test") === null, "Check for null data");
});
test(".data()", function() {
|