diff --git a/tests/unit/listview/listview_core.js b/tests/unit/listview/listview_core.js index 3f27144e..dd44fef7 100644 --- a/tests/unit/listview/listview_core.js +++ b/tests/unit/listview/listview_core.js @@ -706,4 +706,28 @@ } ]); }); + + asyncTest( "nested pages hash key is always in the hash (replaceState)", function(){ + $.testHelper.pageSequence([ + function(){ + //reset for relative url refs + $.testHelper.openPage( "#" + home ); + }, + + function(){ + // https://github.com/jquery/jquery-mobile/issues/1617 + $.testHelper.openPage("#nested-lists-test"); + }, + + function(){ + // Click on the link of the third li element + $('.ui-page-active li:eq(2) a:eq(0)').click(); + }, + + function(){ + ok( location.hash.search($.mobile.subPageUrlKey) >= 0 ); + start(); + } + ]); + }); })(jQuery); diff --git a/tests/unit/listview/listview_pushstate.js b/tests/unit/listview/listview_pushstate.js new file mode 100644 index 00000000..6af09e7c --- /dev/null +++ b/tests/unit/listview/listview_pushstate.js @@ -0,0 +1,15 @@ +(function($) { + asyncTest( "nested pages hash key is always in the hash on default page with no id (replaceState) ", function(){ + $.testHelper.pageSequence([ + function(){ + // Click on the link of the third li element + $('.ui-page-active li:eq(2) a:eq(0)').click(); + }, + + function(){ + ok( location.hash.search($.mobile.subPageUrlKey) >= 0 ); + start(); + } + ]); + }); +})(jQuery); \ No newline at end of file diff --git a/tests/unit/listview/pushstate-tests.html b/tests/unit/listview/pushstate-tests.html new file mode 100644 index 00000000..2ce7597d --- /dev/null +++ b/tests/unit/listview/pushstate-tests.html @@ -0,0 +1,75 @@ + + + + + + jQuery Mobile Listview Integration Test + + + + + + + + + + + + + +

jQuery Mobile Listview Integration Test

+

+

+
    +
+ +
+
+

Basic multiple lists view

+
+
+ + +
+
+ + +