Navigation Menu

Skip to content

Commit

Permalink
Add tests for Element#retrieve.
Browse files Browse the repository at this point in the history
  • Loading branch information
savetheclocktower committed Dec 15, 2008
1 parent 2403e3e commit f8a2522
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/unit/dom_test.js
Expand Up @@ -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");
Expand Down

0 comments on commit f8a2522

Please sign in to comment.