Skip to content

Commit 475069b

Browse files
committed
added test for prefetched dialog pages
1 parent 61f6818 commit 475069b

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

tests/unit/navigation/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,5 +277,14 @@ <h1>Dialog</h1>
277277
<div id="inject-links-page" data-nstest-role="page">
278278
<a href="#injected-test-page" id="static-injected-test-page-link">static link</a>
279279
</div>
280+
281+
<div id="prefetched-dialog-page" data-nstest-role="page">
282+
<a href="prefetched-dialog.html"
283+
id="prefetched-dialog-link"
284+
data-nstest-role="prefetch"
285+
data-nstest-rel="dialog">
286+
static link
287+
</a>
288+
</div>
280289
</body>
281290
</html>

tests/unit/navigation/navigation_core.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,25 @@
930930
]);
931931
});
932932

933+
asyncTest( "prefetched links with data rel dialog result in a dialog", function() {
934+
$.testHelper.pageSequence([
935+
// open our test page
936+
function(){
937+
// Navigate to any page except the first page of the application.
938+
$.testHelper.openPage("#prefetched-dialog-page");
939+
},
940+
941+
function() {
942+
$("#prefetched-dialog-link").click();
943+
},
944+
945+
function() {
946+
ok( $.mobile.activePage.is(".ui-dialog"), "prefetched page is rendered as a dialog" );
947+
start();
948+
}
949+
]);
950+
});
951+
933952

934953
asyncTest( "application url with dialogHashKey loads application's first page", function(){
935954
$.testHelper.pageSequence([
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Title Tag</title>
6+
</head>
7+
<body>
8+
<div data-nstest-role="page" id="prefetched-dialog"></div>
9+
</body>
10+
</html>

0 commit comments

Comments
 (0)