Unit test for issue #1913 - unnecessary ajax call and duplicate DOM nodes when refreshing a page with a dialog visible.

This commit is contained in:
Kin Blas 2011-06-23 16:41:26 -07:00
parent c81b8cc181
commit 53d375cd0a
2 changed files with 21 additions and 1 deletions

View file

@ -28,10 +28,13 @@
<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>

View file

@ -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);