mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-24 09:50:26 +00:00
Unit test to catch issues like 1767.
- Test passing string as data option to changePage(). - Test passing object as data option to changePage().
This commit is contained in:
parent
b31825a1d7
commit
489fc19fb1
2 changed files with 45 additions and 0 deletions
8
tests/unit/navigation/form-tests/changepage-data.html
Normal file
8
tests/unit/navigation/form-tests/changepage-data.html
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<div id="changepage-data" data-nstest-role="page"> </div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -422,4 +422,41 @@
|
|||
}
|
||||
], 1000);
|
||||
});
|
||||
|
||||
asyncTest( "query data passed as string to changePage is appended to URL", function(){
|
||||
|
||||
$.testHelper.pageSequence([
|
||||
// open our test page
|
||||
function(){
|
||||
$.mobile.changePage( "form-tests/changepage-data.html", {
|
||||
data: "foo=1&bar=2"
|
||||
} );
|
||||
},
|
||||
|
||||
function(){
|
||||
same(location.hash, "#form-tests/changepage-data.html?foo=1&bar=2");
|
||||
start();
|
||||
}
|
||||
]);
|
||||
});
|
||||
|
||||
asyncTest( "query data passed as object to changePage is appended to URL", function(){
|
||||
|
||||
$.testHelper.pageSequence([
|
||||
// open our test page
|
||||
function(){
|
||||
$.mobile.changePage( "form-tests/changepage-data.html", {
|
||||
data: {
|
||||
foo: 3,
|
||||
bar: 4
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
function(){
|
||||
same(location.hash, "#form-tests/changepage-data.html?foo=3&bar=4");
|
||||
start();
|
||||
}
|
||||
]);
|
||||
});
|
||||
})(jQuery);
|
||||
|
|
|
|||
Loading…
Reference in a new issue