From 53d375cd0a4b72fdbbc92db64f6b01a251a7d8ec Mon Sep 17 00:00:00 2001 From: Kin Blas Date: Thu, 23 Jun 2011 16:41:26 -0700 Subject: [PATCH] Unit test for issue #1913 - unnecessary ajax call and duplicate DOM nodes when refreshing a page with a dialog visible. --- tests/unit/navigation/index.html | 5 ++++- tests/unit/navigation/navigation_core.js | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/unit/navigation/index.html b/tests/unit/navigation/index.html index 3c6833e1..3876c0b2 100644 --- a/tests/unit/navigation/index.html +++ b/tests/unit/navigation/index.html @@ -28,10 +28,13 @@
-
+
+
+
+
diff --git a/tests/unit/navigation/navigation_core.js b/tests/unit/navigation/navigation_core.js index 6a57262f..a0134937 100644 --- a/tests/unit/navigation/navigation_core.js +++ b/tests/unit/navigation/navigation_core.js @@ -476,4 +476,21 @@ } ]); }); + + asyncTest( "refresh of a dialog url should not duplicate page", function(){ + + $.testHelper.pageSequence([ + // open our test page + function(){ + same($(".foo-class").length, 1, "should only have one instance of foo-class in the document"); + location.hash = "#foo&ui-state=dialog"; + }, + + function(){ + same(location.hash, "#foo&ui-state=dialog", "hash should match what was loaded"); + same($(".foo-class").length, 1, "should only have one instance of foo-class in the document"); + start(); + } + ]); + }); })(jQuery);