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

Commit

Permalink
added test for prefetched dialog pages
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbender committed Oct 11, 2011
1 parent 61f6818 commit 475069b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/unit/navigation/index.html
Expand Up @@ -277,5 +277,14 @@ <h1>Dialog</h1>
<div id="inject-links-page" data-nstest-role="page">
<a href="#injected-test-page" id="static-injected-test-page-link">static link</a>
</div>

<div id="prefetched-dialog-page" data-nstest-role="page">
<a href="prefetched-dialog.html"
id="prefetched-dialog-link"
data-nstest-role="prefetch"
data-nstest-rel="dialog">
static link
</a>
</div>
</body>
</html>
19 changes: 19 additions & 0 deletions tests/unit/navigation/navigation_core.js
Expand Up @@ -930,6 +930,25 @@
]);
});

asyncTest( "prefetched links with data rel dialog result in a dialog", function() {
$.testHelper.pageSequence([
// open our test page
function(){
// Navigate to any page except the first page of the application.
$.testHelper.openPage("#prefetched-dialog-page");
},

function() {
$("#prefetched-dialog-link").click();
},

function() {
ok( $.mobile.activePage.is(".ui-dialog"), "prefetched page is rendered as a dialog" );
start();
}
]);
});


asyncTest( "application url with dialogHashKey loads application's first page", function(){
$.testHelper.pageSequence([
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/navigation/prefetched-dialog.html
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title Tag</title>
</head>
<body>
<div data-nstest-role="page" id="prefetched-dialog"></div>
</body>
</html>

0 comments on commit 475069b

Please sign in to comment.