mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
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:
parent
c81b8cc181
commit
53d375cd0a
2 changed files with 21 additions and 1 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue