added tests to verify that dialogs referencing themselves with query params don't do anything

This commit is contained in:
John Bender 2011-04-13 23:50:40 -07:00
parent 59bd1400ad
commit a267a3077c
3 changed files with 49 additions and 0 deletions

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
</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 id="dialog-param-link-page" data-nstest-role="page">
<a href="?foo=bar" data-rel="dialog"></a>
</div>
</body>
</html>

View file

@ -177,5 +177,9 @@
<div data-nstest-role="page" id="self-link">
<a href="#self-link">self!</a>
</div>
<div data-nstest-role="page" id="dialog-param-link">
<a href="dialog-param.html">go</a>
</div>
</body>
</html>

View file

@ -394,4 +394,31 @@
], 1000);
});
asyncTest( "query param link from a dialog to a dialog should be a no op", function(){
var firstDialogHash;
$.testHelper.sequence([
function(){
$.testHelper.openPage("#dialog-param-link");
},
function(){
$("#dialog_param-link a").click();
},
function(){
firstDialogHash = location.hash;
$("#dialog-param-link-dialog a").click();
},
function(){
$("#dialog-param-link-dialog a").click();
},
function(){
same(location.hash, firstDialogHash, "additional dialog param not added");
start();
}
], 1000);
});
})(jQuery);