Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Unit test for issue #1913 - unnecessary ajax call and duplicate DOM n…
Browse files Browse the repository at this point in the history
…odes when refreshing a page with a dialog visible.
  • Loading branch information
jblas committed Jun 23, 2011
1 parent c81b8cc commit 53d375c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/unit/navigation/index.html
Expand Up @@ -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>
Expand Down
17 changes: 17 additions & 0 deletions tests/unit/navigation/navigation_core.js
Expand Up @@ -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 53d375c

Please sign in to comment.