mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-26 09:04:43 +00:00
added to to verify that the nested pages are preserved when the parent page is cached
This commit is contained in:
parent
3dc9f975e6
commit
7a6b28d398
1 changed files with 30 additions and 6 deletions
|
|
@ -489,11 +489,11 @@
|
|||
ok( $("#enhancetest").trigger("create").find(".ui-listview").length, "enhancements applied" );
|
||||
});
|
||||
|
||||
asyncTest( "nested pages are removed from the dom by default", function(){
|
||||
var findNestedPages = function(){
|
||||
return $( "#uncached-nested-list #topmost" ).listview( 'childPages' );
|
||||
};
|
||||
var findNestedPages = function(selector){
|
||||
return $( selector + " #topmost" ).listview( 'childPages' );
|
||||
};
|
||||
|
||||
asyncTest( "nested pages are removed from the dom by default", function(){
|
||||
$.testHelper.pageSequence([
|
||||
function(){
|
||||
//reset for relative url refs
|
||||
|
|
@ -505,12 +505,36 @@
|
|||
},
|
||||
|
||||
function(){
|
||||
ok( findNestedPages().length > 0, "verify that there are nested pages" );
|
||||
ok( findNestedPages( "#uncached-nested-list" ).length > 0, "verify that there are nested pages" );
|
||||
$.testHelper.openPage( "#" + location.pathname + "cache-tests/clear.html" );
|
||||
},
|
||||
|
||||
function(){
|
||||
same( findNestedPages().length, 0 );
|
||||
same( findNestedPages( "#uncached-nested-list" ).length, 0 );
|
||||
start();
|
||||
}
|
||||
]);
|
||||
});
|
||||
|
||||
asyncTest( "nested pages preserved when parent page is cached", function(){
|
||||
|
||||
$.testHelper.pageSequence([
|
||||
function(){
|
||||
//reset for relative url refs
|
||||
$.testHelper.openPage( "#" + location.pathname );
|
||||
},
|
||||
|
||||
function(){
|
||||
$.testHelper.openPage( "#cache-tests/cached-nested.html" );
|
||||
},
|
||||
|
||||
function(){
|
||||
ok( findNestedPages( "#cached-nested-list" ).length > 0, "verify that there are nested pages" );
|
||||
$.testHelper.openPage( "#" + location.pathname + "cache-tests/clear.html" );
|
||||
},
|
||||
|
||||
function(){
|
||||
ok( findNestedPages( "#cached-nested-list" ).length > 0, "nested pages remain" );
|
||||
start();
|
||||
}
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue