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

Commit b1da5f0

Browse files
committed
added tests to make sure links that reference the pages they are defined within don't transition Fixes #1360
1 parent 05cc415 commit b1da5f0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/unit/navigation/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,9 @@ <h1>Dialog</h1>
172172
<div data-nstest-role="page" id="titletest5" data-nstest-title="Title Attr">
173173
<div data-nstest-role="header"><h1>Title Heading</h1></div>
174174
</div>
175+
176+
<div data-nstest-role="page" id="self-link">
177+
<a href="#self-link">self!</a>
178+
</div>
175179
</body>
176180
</html>

tests/unit/navigation/navigation_core.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,4 +420,18 @@
420420
}
421421
], 500);
422422
});
423+
424+
asyncTest( "Page links to the current active page result in the same active page", function(){
425+
$.testHelper.openPage("#self-link");
426+
$.testHelper.sequence([
427+
function(){
428+
$("a[href='#self-link']").click();
429+
},
430+
431+
function(){
432+
same($.mobile.activePage[0], $("#self-link")[0], "self-link page is still the active page" );
433+
start();
434+
}
435+
], 500);
436+
});
423437
})(jQuery);

0 commit comments

Comments
 (0)