From 890c96146e1be8a0eb2f2702640ea1340c8eefc2 Mon Sep 17 00:00:00 2001 From: John Bender Date: Fri, 23 Sep 2011 10:37:31 -0700 Subject: [PATCH] test core helpers --- tests/unit/core/core.js | 12 ++++++++++++ tests/unit/core/index.html | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/tests/unit/core/core.js b/tests/unit/core/core.js index 5b5b9b19..20af9684 100644 --- a/tests/unit/core/core.js +++ b/tests/unit/core/core.js @@ -105,4 +105,16 @@ }); + test( "addDependents works properly", function() { + same( $("#parent").jqmData('dependents'), undefined ); + $( "#parent" ).addDependent( $("#dependent") ); + same( $("#parent").jqmData('dependents').length, 1 ); + }); + + test( "removeWithDependents removes the parent element and ", function(){ + $( "#parent" ).addDependent( $("#dependent") ); + same($( "#parent, #dependent" ).length, 2); + $( "#parent" ).removeWithDependents(); + same($( "#parent, #dependent" ).length, 0); + }); })(jQuery); \ No newline at end of file diff --git a/tests/unit/core/index.html b/tests/unit/core/index.html index 95517d9f..0a674a51 100644 --- a/tests/unit/core/index.html +++ b/tests/unit/core/index.html @@ -28,5 +28,9 @@
+
+
+
+