mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-21 21:01:51 +00:00
added test for explicit page caching via data attribute
This commit is contained in:
parent
151d55f351
commit
1a95670012
2 changed files with 30 additions and 0 deletions
10
tests/unit/navigation/cached-external.html
Normal file
10
tests/unit/navigation/cached-external.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<div data-nstest-role="page" id="external-test-cached" data-nstest-ajax-dom-caching="true">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -44,6 +44,26 @@
|
|||
]);
|
||||
});
|
||||
|
||||
asyncTest( "external page is cached in the DOM after pagehide", function(){
|
||||
$.testHelper.pageSequence([
|
||||
function(){
|
||||
$.mobile.changePage( "cached-external.html" );
|
||||
},
|
||||
|
||||
// page is pulled and displayed in the dom
|
||||
function(){
|
||||
same( $( "#external-test-cached" ).length, 1 );
|
||||
window.history.back();
|
||||
},
|
||||
|
||||
// external test page is cached in the dom after transitioning away
|
||||
function(){
|
||||
same( $( "#external-test-cached" ).length, 1 );
|
||||
start();
|
||||
}
|
||||
]);
|
||||
});
|
||||
|
||||
asyncTest( "forms with data attribute ajax set to false will not call changePage", function(){
|
||||
var called = false;
|
||||
var newChangePage = function(){
|
||||
|
|
|
|||
Loading…
Reference in a new issue