Permalink
Browse files

Unit test for issue #1913 - unnecessary ajax call and duplicate DOM n…

…odes when refreshing a page with a dialog visible.
  • Loading branch information...
1 parent 9b2ce84 commit eababf93b3cbd11ea4fb79f1b5c1e0ccb6bb9686 @jblas jblas committed Jun 23, 2011
Showing with 21 additions and 1 deletion.
  1. +4 −1 tests/unit/navigation/index.html
  2. +17 −0 tests/unit/navigation/navigation_core.js
@@ -28,10 +28,13 @@ <h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests">
</ol>
-<div id="foo" data-nstest-role="page">
+<div id="foo" data-nstest-role="page" class="foo-class">
<a href="#bar" data-nstest-transition="flip"></a>
</div>
+<div id="foozball" data-nstest-role="page">
+</div>
+
<div id="bar" data-nstest-role="page">
<a href="#baz"></a>
</div>
@@ -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);

0 comments on commit eababf9

Please sign in to comment.