From f8a25223d090ecbbcd6545aaf676fff0eb741700 Mon Sep 17 00:00:00 2001 From: savetheclocktower Date: Mon, 15 Dec 2008 09:37:12 -0600 Subject: [PATCH] Add tests for Element#retrieve. --- test/unit/dom_test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/unit/dom_test.js b/test/unit/dom_test.js index 4145e40..f82e01e 100644 --- a/test/unit/dom_test.js +++ b/test/unit/dom_test.js @@ -1379,6 +1379,9 @@ new Test.Unit.Runner({ element.getStorage().unset('bar'); this.assertEnumEqual($w('foo'), element.getStorage().keys(), "Getting the storage hash after unsetting a key"); + this.assertUndefined(element.retrieve('bar'), "Undefined key should return undefined if default value is not defined"); + this.assertEqual("default", element.retrieve('bar', 'default'), "Return default value if undefined key"); + this.assertEqual("default", element.retrieve('bar'), "Makes sure default value as been set properly"); var clonedElement = $('test-empty').cloneNode(false); this.assert(!('_prototypeUID' in clonedElement), "Cloning a node should not confuse the storage engine");