Skip to content

Commit

Permalink
moved push state dialog key test down into its own file to have the k…
Browse files Browse the repository at this point in the history
…ey at the root
  • Loading branch information
johnbender committed Aug 27, 2011
1 parent 1811b31 commit c3bac78
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 24 deletions.
24 changes: 0 additions & 24 deletions tests/unit/navigation/navigation_core.js
Expand Up @@ -692,30 +692,6 @@
]);
});

asyncTest( "dialog ui-state should be part of the hash", function(){
$.testHelper.sequence([
function() {
// open the test page
$.testHelper.openPage("#nested-dialog-page");
},

function() {
// open the dialog
$("#nested-dialog-page a").click();
},

function() {
// verify that the hash contains the dialogHashKey
ok( location.hash.search($.mobile.dialogHashKey) >= 0 );
$.testHelper.openPage( "#" + home );
},

function() {
start();
}
]);
});

asyncTest( "handling of button active state when navigating by clicking back button", 1, function(){

$.testHelper.pageSequence([
Expand Down
16 changes: 16 additions & 0 deletions tests/unit/navigation/navigation_dialog_pushstate.js
@@ -0,0 +1,16 @@
(function($) {
asyncTest( "dialog ui-state should be part of the hash", function(){
$.testHelper.sequence([
function() {
// open the test page
$.mobile.activePage.find( "a" ).click();
},

function() {
// verify that the hash contains the dialogHashKey
ok( location.hash.search($.mobile.dialogHashKey) >= 0 );
start();
}
]);
});
})(jQuery);
38 changes: 38 additions & 0 deletions tests/unit/navigation/push-state-dialog-tests.html
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Mobile Navigation Test Suite</title>

<script src="../../../js/jquery.js"></script>
<script src="../jquery.setNameSpace.js"></script>
<script src="../../../js/"></script>
<script src="../../../tests/jquery.testHelper.js"></script>


<link rel="stylesheet" href="../../../themes/default/"/>
<link rel="stylesheet" href="../../../external/qunit.css"/>
<script src="../../../external/qunit.js"></script>

<script type="text/javascript" src="navigation_dialog_pushstate.js"></script>
</head>
<body>

<h1 id="qunit-header">jQuery Mobile Navigation Test Suite</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests">
</ol>

<div data-nstest-role="page">
<a href="#dialog">open the dialog</a>
</div>

<div id="dialog" data-nstest-role="dialog">
<div data-nstest-role="header" data-nstest-position="inline">
<h1>Dialog</h1>
</div>
</div>
</body>
</html>

0 comments on commit c3bac78

Please sign in to comment.